Hello @Vagni
I'll answer your questions one by one.
- Is the SysTick timer really needed? It is initialized to generate 1ms interrupt, but it seems not used.
->> No, it is not needed.
- PRINTF("\r\n Config flash memory access time. \r\n"): actually, nothing is done, right?
->> Yes.
- The example is configured to run at 150MHz mcu clock frequency, right? Internal Flash memory can be erased/programmed by firmware at 150MHz with 3 additional wait-state (like Clocks Config Tool does), right?
->>Yes.
- MCXN547 device embeds up to 2 MB of flash, implemented as 2 x 1MB flash block instances. The example runs from the flash block #0 and erases/programs one sector on the flash block #1. I verified the example also successfully erases/programs one sector on the same flash block #0, is it true?
->>Yes, It can work well as long as you don't erase or program the address that your code uses. Also, the start address must be sector - size aligned (that is, a multiple of 8 KB).
- If I try to erase the same sector written before, the FLASH_VerifyErase() returns 154 error code: what is it? The 154 error code is not listed in the MCXN Reference Manual among the possible return codes of the FLASH APIs.
- Even if FLASH_VerifyErase() returns 154 error code, the data program and verify are then successfull: is it normal?
->> About the two questions, please send your project that can reproduce the issue. Thanks.
- The example has both SysTick timer and UART interrupts enabled while performing internal flash accesses: is it right? Or should all the interrupts be disabled while erasing/programming the same flash block where the ISR vector table is defined?
->> This is just a demo, in real project, we recommend disable all the interrupt when erasing/programming flash.
Hope it helps.
BR
Alice