Flash memory access

hello, how can I use some part of hifive rev b flash memory as a non volatile read/write memory.

It’s possible but not trivial.

You need to copy the flash writing code into SRAM and run it. That code will turn off eXecute-In-Place, write data to the flash, then re-enable XIP and return.

There really should be a library for this, but I don’t recall seeing one.