-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ex_03d_tx_wait_resp_interrupts receives response with corrupted data. #2
Comments
@foldedtoad I ran into this issue also ... it is very confusing. A few notes from my debugging.... It happens when the dwt_readrxdata() is called inside the rx_ok_cb ISR and when the data to read exceeds some length. I noticed it only happened to the last few bytes of the RX_FINAL message which is the longest. So maybe if length > 18. It appears to be a Zephyr issue. I hooked up a logic analyzer to the shield and confirmed that SPI transaction is correct. However, it is not what spi_transeive() in your 'readfromspi.c' returns! If you look at memory with the Ozone, you will see that some time AFTER the ISR exits, the correct bytes show up. My conclusion is that somehow the SPI transaction is not fully completed when the ISR is invoked. At this point I have no clue how to fix. My temporary 'hack' was to notify my app from the ISR and call dwt_readrxdata() in the app. Hopefully this gives some you some info and maybe we can figure this out? ps. I believe DW3000 IC 'User Manual' is available on their webite and does not need NDA. |
I recently received a Nucleo-F429ZI board and have made good progress on getting it to work with this project's code.
This interesting aspect is that the 'hole' is consistently in the middle of the data at same offset (for nRF52840). Yes, I have a copy of the DW3000 User manual. I printed/bound it as I like to make notes in a hardcopy...just a thing I have. :-) Thanks for passing your insights on to me. |
So here are my results in testing (same conditions) with the PCA10040 (nRF52832) build of this code.
This would indicate this problem is limited to the nRF52840 build. I will continue to delve into this issue. |
One thing I noticed is that you have not defined the port routines, port_DisableEXT_IRQ, port_EnableEXT_IRQ, etc. These are used by the decamutexon() or decamutexoff() routines to mask interrupts. Since interrupts are not being masked, I wonder if this is causing some issues in certain cases. I am not sure how to do this under Zephyr since the gpio abstraction hides the IRQ and such. I think the nrfx spim routines might use DMA. I am using this driver code and have found the SPI to hang on the board dependent on SPI speed and other random hangs during longevity tests. |
I'll take a look at the two functions you mentioned. |
I've been looking into this off and on for a week now...here is what I have found.
In spi_nrfx_spim.c circa line 198
The output looks like this --
|
I do not have my board setup to test at the moment, but if you happen to have time, can you try enabling zephyr_compile_definitions(NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED=1) After some searching, I see that it is NOT enabled by default, yet it seems to impact current revision chips. EDIT: I did try this on code I am using, not the ex_03d, and at least on my code it does not appear to fix anything. |
When running the project pair
ex_03a_tx_wait_resp
andex_03b_rx_send_resp
, the response data is received by tx-side as expected, e.g. no data corruption of frame. In other words, this pair of programs run expected.But when running
ex_03d_tx_wait_resp_interrupt
andex_03b_rx_send_resp
, the response data received by the tx-side has been partially zero-ed.The rx-side received the tx-side message and uses it to build the response data, which is shown below.
While the tx-side receives the response data, the data (frame) has a section zero-ed.
Note that the tx-side receives interrupts without problems, it's just the data that is partially zero-ed.
Status: Currently investigating. Need to get detailed info (DWM3000 datasheet) from Qorvo/Decawave.
Appears NDA is needed to receive details.
The text was updated successfully, but these errors were encountered: