Tool/software: TI-RTOS
I have started with the SimpleLink example for CC2640r2F and added code to write into the internal FLASH in the main function.
The intention is to have one sector in the FLASH to store configuration/parameters for the application.
For test I have added the following lines of code in main()
uint8_t array[] = {1, 2, 3, 4, 5};
uint8_t array2[10];
HalFlashErase( 29 );
HalFlashWrite( 0x1D000, array, 5 );
HalFlashRead(29, 0, array2, 10 );
The data read back is the data that was in the FLASH before I started to erase. Even if I add a very long loop, more that 30 seconds, after the write it is still the same value that is read.
If I make a reset of the CPU or if I let the program run the value in the FLASH will be updated.
My quess is the it has something with a cache to do and that it needs to be flushed or something.
And please don't tell me to use osal_snv_read or write since this seems not to be possible without registering a task to ICall and at the moment when I want to read the configuration there is no task started.
Regards Ørjan