How do I save application data on my MCU in NVM?
I'm using the STMF1 series and the HAL drivers. I already use a boot-loader to write into application space. However, now the the application to take some input data and save it permanently to a non-volatile-memory space.
I assume I can use the HAL_FLASH generically driver to save data permanently on the chip. By following this document: https://www.st.com/content/ccc/resource/technical/document/user_manual/72/52/cc/53/05/e3/4c/98/DM00154093.pdf/files/DM00154093.pdf/jcr:content/translations/en.DM00154093.pdf
However, isn't this also where my program is stored? How do i declare a user-space so that i can safely write to a location in flash? Is it just to declare a constant object and then write to its location, or some sort of block/page object?
Perhaps there is a good application example document for this?