darrylring commented on issue #20188:
URL: https://github.com/apache/nuttx/issues/20188#issuecomment-5937385077

   Actually, there's some overlap with another feature I am working on, which 
is connecting the high-cycle flash region (EDATA) to an MTD driver. Both need 
to deal with the double ECC errors.
   
   There are three approaches to take here:
   
   1. Attach an NMI handler in `stm32h563xx_flash.c` that can share some state 
with the read functions to check what address is read accessed and act 
accordingly.
   2. Mask the flash double ECC error NMI before each read.
   3. Mask the flash double ECC error NMI at initialization.
   
   I'm leaning toward #2 as the least invasive option.
   
   Both also need to deal with the ICACHE issue: they must either be marked as 
non-cacheable with the MPU, or be read with the ICACHE disabled. The closest 
precedent I can find is that `stm32_get_uniqueid` disables the ICACHE before 
reading the unique ID (which is in the same region as the OTP).
   
   I'm looking for feedback. Maybe I'm overthinking this, but quietly eating up 
two MPU regions (if both features are enabled) seems less desirable than just 
toggling the ICACHE off before a read.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to