Flash Memory Read/Write
Answer
2/7/19 2:01 PM

Hello everyone,

I tried to write 90bytes into the XDK Flash Memory but, If I write twice I lost the data, he is corrupted - seems like another process write into this area too.
I used the BCDS_MCU_Flash.h functions to write and read data, according a document from XDK-Community - page 24 - (please see beloow), there is a space starting on address 0x000B6000 where it's possible to write and read some data.
I do not use the FOTA, so this area it's not reserved too.

Does anyone could help me?

Thank you

Document Xdk Community - (https://xdk.bosch-connectivity.com/community?p_p_id=101&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_101_struts_action=%2Fasset_publisher%2Fview_content&_101_returnToFullPageURL=%2Fcommunity%2F-%2Fmessage_boards%2Fmessage%2F366476&_101_assetEntryId=219904&_101_type=document&_101_showComments=true&_101_redirect=https%3A%2F%2Fxdk.bosch-connectivity.com%2Fcommunity%3Fp_p_id%3D3%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_3_advancedSearch%3Dfalse%26_3_groupId%3D37728%26_3_keywords%3DFlash%2BMemory%26_3_delta%3D20%26_3_resetCur%3Dfalse%26_3_cur%3D2%26_3_struts_action%3D%252Fsearch%252Fsearch%26_3_redirect%3D%252Fcommunity%252F-%252Fmessage_boards%252Fmessage%252F366476%26_3_andOperator%3Dtrue)

0 (0 Votes)
RE: Flash Memory Read/Write
Answer
2/7/19 4:48 PM as a reply to Bruno Sato.
Hello Bruno,

As you correctly pointed out the memory you accessed should be in the reserved memory space and not be overwritten as long as no FOTA is used.
Therefore my question is your XDK and the project using a bootloader of version 1.0.0 or later?
If you require to update the bootloader on the XDK you will require a debugger like the J-Link 9-Pin Cortex-M Adapter by SEGGER.

However is neither of those was the issue in your case, I would kindly ask you to go into more detail or provide source code to replicate your issue.

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: Flash Memory Read/Write
Answer
2/7/19 6:35 PM as a reply to Franjo Stjepandic.

Franjo,

Reading the BCDS_MCU_Flash.h documentation I discover the problem.

When the flash memory was erased, the value FFFFF (in hexa) is written, after that in the write data process the lib BCDS_MCU_Flash.h do a AND operation between your data and de FFFF bits to write value on memory.

Thank you guy.

0 (0 Votes)
RE: Flash Memory Read/Write
Answer
2/8/19 1:34 PM as a reply to Bruno Sato.
Hello Bruno,

I am glad that you found the solution to your issue.

Please feel free to open up new threads for new issues or further questions. Kind regards,
Franjo
0 (0 Votes)