Description
Description
I have discovered a bug with the nRF52840 QSPI hal driver while trying to get some examples to work. I was only seeing partial data being read back. The example was trying to write "hello\0", but when read back it would only product "hell"... as if the bug was trying to speak to me.
I narrowed it down to a fine print item in the nRF52840 datasheet concerning the length of QSPI read/writes (see attached screen captures):
Read/Write chunks must be multiples of 4 bytes. The current HAL driver simply populates this register from the user's input. In my toy case, this results in 6 being written to the READ.CNT and WRITE.CNT registers, where the nRF52840 ignores the lower bits and truncates the transfer lengths to 4 bytes.
See the functions here that call the underlying Nordic driver functions:
mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/qspi_api.c
Lines 248 to 277 in d30ae07
If you need any other information or want me to upload my toy code, let me know.
Issue request type
[ ] Question
[ ] Enhancement
[x] Bug