Comments (4)
This looks like a question for @microbit-carlos
from daplink.
Hi @relia1, I think I understand more or less the issue, but need to confirm some things from your description:
- Disconnect the device from the USB and then plug it back in
Is there a battery pack connected to the micro:bit in this scenario. Or does disconnect and reconnect the USB cable mean the board fully power cycled?
Intermittently getting unending busy being returned (0x39)
Is that from the lsm303agr?
Who/what is "returning busy" and where is the value 0x39 coming from?
Intermittently I am getting addressnack back from the i2c interface
When trying to communicate with the LSM?
I've never seen this specific issue before, which on first impression might independent of the interrupt signal?
If a NACK is received after sending the address it usually means no device has responded, which might be unrelated to the Interface MCU with DAPLink? This one might be harder to diagnose.
with the user program unable to get interrupts
Unable to get interrupts? What does that mean exactly?
As you mentioned later, assuming the issue is that DAPLink is keeping the shared interrupt line "active", do you mean that no additional interrupt is being detected in the target MCU pin simply because the signal is not toggling (as DAPLink is already pulling it)?
Or do you mean something else?
Adding a sleep and a dummy read on the i2c interface has seemed to help a decent bit,
Just to double check, this is an I2C read from the Interface MCU running DAPLink?
Which address?
When are you doing this dummy read?
As you have already noticed, there are some events in the Interface MCU that will assert the interrupt signal and keep it asserted until an I2C read operation is performed. Mostly pressing the reset button for 5 seconds, or inserting the USB cable when battery powered.
The interrupt signal will stay asserted until an I2C read is done, so any other interrupts from other devices in the shared pin will be "lost".
Assuming you are doing a sleep and dummy read on startup, it might also be important to ensure the sleep is around 1 second, as it might take that long for DAPLink to fully startup.
from daplink.
Is there a battery pack connected to the micro:bit in this scenario. Or does disconnect and reconnect the USB cable mean the board fully power cycled?
Just connected via the USB cable (no battery pack)
Is that from the lsm303agr? Who/what is "returning busy" and where is the value 0x39 coming from?
That value was when I was doing an i2c read to 0x70 (I2C config/comms interface)
When trying to communicate with the LSM? I've never seen this specific issue before, which on first impression might independent of the interrupt signal? If a NACK is received after sending the address it usually means no device has responded, which might be unrelated to the Interface MCU with DAPLink? This one might be harder to diagnose.
This would be I2C config/comms interface returning that
Unable to get interrupts? What does that mean exactly? As you mentioned later, assuming the issue is that DAPLink is keeping the shared interrupt line "active", do you mean that no additional interrupt is being detected in the target MCU pin simply because the signal is not toggling (as DAPLink is already pulling it)? Or do you mean something else?
Yeah specifically not seeing the shared interrupt line interrupts coming from the lsm303agr due to the line already being held down.
Just to double check, this is an I2C read from the Interface MCU running DAPLink? Which address? When are you doing this dummy read?
I keep getting it flipped on which is target and which is interface, but I think it is a read from the target mcu to the interface mcu over i2c.
As you have already noticed, there are some events in the Interface MCU that will assert the interrupt signal and keep it asserted until an I2C read operation is performed. Mostly pressing the reset button for 5 seconds, or inserting the USB cable when battery powered.
Assuming you are doing a sleep and dummy read on startup, it might also be important to ensure the sleep is around 1 second, as it might take that long for DAPLink to fully startup.
That's pretty much what I have done. But it hasn't helped in the scenario in which I unplug/plug it back in (without the battery pack)
from daplink.
Is that from the lsm303agr? Who/what is "returning busy" and where is the value 0x39 coming from?
That value was when I was doing an i2c read to 0x70 (I2C config/comms interface)
Ah, I see, thanks for the clarification.
This is the "default" state when there is nothing to report.
When trying to communicate with the LSM? I've never seen this specific issue before, which on first impression might independent of the interrupt signal? If a NACK is received after sending the address it usually means no device has responded, which might be unrelated to the Interface MCU with DAPLink? This one might be harder to diagnose.
This would be I2C config/comms interface returning that
So just to confirm, sometimes when trying to do an I2C transmission to address 0x70, there is a NACK after the address, which would indicate no device has responded, is that right?
So, how often are you trying to communicate with the Interface via I2C? From the link to the repo you've posted it looks like it's only done once during startup?
If that's the case, I guess it's possible the I2C transmission is attempted before the Interface had a chance to initialise the I2C driver and that might be why it's not ACKing.
However, there is already a 1 second delay during startup, so that should have given the Interface enough time to initialise everything. If you increase to something ridiculous like 5 seconds, do you still get NACKs from the Interface?
from daplink.
Related Issues (20)
- Not able to build in windows gcc environment HOT 4
- GNU Arm Embedded Toolchain is deprecated HOT 4
- Building on Mac with latest homebrew-managed `gcc-arm-embedded` fails HOT 2
- uart.c constant comparison issues
- Support for newer versions of GNU Arm Embedded Toolchain
- Address of local variable buffer is assigned to a non-local variable
- PIO0_14 as JTAG TDO
- DAPLink doesn't work with IAR EWARM 8.3? HOT 2
- Unsigned int comparison to 0
- "EraseChip" doesn't seem quite right
- DAPLink worked in IAR,but not work in KEIL MDK. HOT 1
- build error not have version_git.h HOT 2
- Why is it that after I dragged and burned the daplink firmware in bootloader mode, it succeeded, but when I disconnected and reconnected, it changed to bootloader mode. HOT 1
- The latest version of Keil5 always prompts "swd/jtag communication failure" when using DAPLink
- Support for probe interface level translation HOT 1
- Some questions about "MSD Commands"
- [miro:bit] [0258] PWR led turns sometimes off when device is powered by battery on reset button press HOT 3
- CPU Can't stop HOT 1
- Clarification on flash blobs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daplink.