Other Parts Discussed in Thread: HALCOGEN
Hello,
I have RM44 code running "perfectly" (OS, DMA, some peripheral) on RM44 CPU, after some migration work the code run on RM48 but when code is stopped via debugger ESM Group 3 channel 7 errors are active.
Symptoms are weird since if you step code the issue may not appear, also if I for example disable 1 task (suspend it immediately) issue does not apper but if put that same task to delay-loop (only OS delay) the issue again raises itself. Every time I managed to do whole SafeTI based CPU init and start the OS until this error appeared.
Also the FUNC_ERR_ADD register shows with same SW always same value, but if changing code a bit the address may change changes slightly (a couple of bytes). FUNC_ERR_ADD == 0x135a98. My code is only 0x20000 long and as "same code" (not anymore same since needs some HalCoGen changes) works with RM44 I strongly doubt that there isn't any errors in application, also all HalCoGen files are replaced by RM48 variant (this also crazy work to change CPU singe HalCoGen doesn't offer migration option, first put HCLK same and then use .dil files diff & manually move stuff fro mfile to other and hope the best :)).
I also enable MPU from 0x130000 to 0x1400000 with "no code exec, no priviledge access, no user access" and it does not trigger. Tested MPU by setting it to my application area from 0x10000 to 0x20000 and prefetch abort is generated.
After this started to wonder if DMA still somehow would go crazy and do something funky, but understood that it operates non-priviledge so assumed that MPU would catch it, will it actually catch it? And why MPU could find that error reason because FUNC_ERR_ADD clearly shows that the problem is in MPU monitored area...
After days of frustation and reading e2e & remembering old posts read months ago there is that "speculative fetch", could it cause such behavior since once I fully programmed whole ROM the error looks to gone for ever (with IAR IDE I used "linker->checksum->fill from 0 to 0x2FFFFF" option and flashing took literally ages)?
Questions:
- Why my RM44 didn't suffer this speculative fetching (never programmed whole flash)
- Why stepping the code looked to have great impact did the error appear or not
- Do you really need to manually program the whole flash ONCE (is once enough? takes too long to flash it always while debugging)
- Why MPU didn't catch it
- In the production: you need to provide a binary with a whole flash filled? (And basically field updates could be done with normal binary (in case programming time matters)...)
And finally
- based on the symptom was the root cause speculative fetching and is there any means to check that from somewhere since I do not like issues which "macigally disappers", typically these tends to come back sooner or later unless you really know why it disappeared