LoRaWAN_FlashWrite Strange Behavior

Hello All,

I’m trying to use the LoRaWAN_FlashRead and LoRaWAN_FlashWrite API functions, but I see strange behavior. See code snippet below.

uint8_t miscbuf[8];
LoRaWAN_FlashRead(miscbuf, 1, 8);
miscbuf[2] = 49;
miscbuf[3] = 77;
LoRaWAN_FlashWrite(miscbuf, 1, 8);
LoRaWAN_FlashRead(miscbuf, 1, 8);

After the first flash read, miscbuf contains all zeros.
Just before the flash write, the third and fourth elements of miscbuf are 49 and 77, respectively.
After the flash write, miscbuf again contains all zeros.
After the second flash read, miscbuf still contains all zeros.

Am I doing something wrong here?

Paul

Hi Paul,

Thank you for the feedback! I was able to recreate this. We will get back to you shortly!

Tom

Hi Paul,

We’ve got a workaround for the Flashwrites in our latest stack. It can be found on our GitHub API page.

Be sure to add "-DCY_FLASH_RWW_DRV_SUPPORT_DISABLED" to the compiler options in CMakeLists.txt.

Rolf

Hi Rolf,

Unfortunately, adding the flag in CMakeLists.txt did not change anything. The LoRaWAN_FlashWrite operation still cleared the source array.

Perhaps I didn’t add the flag in the right place. Here’s a screenshot:

Paul

All I can say is that we had some problems with the stack at that moment. Currently it’s solved as with a lot of other (minor) issues.