-2

All I am trying to write certifictae and key to flash EEPROM of stm32 , I know we can write the string but is it possible to write whole certificate(.der) in flash. I am using stm32f7 microcontroller and using internal eeprom. and I want to add certificate and key at run time. I can write a simple Json object to the node and it works fine but i have no idea if i can write a cert.der/key.der in the Mcu.

embbo
  • 1
  • 2
  • Of course you can. But you need to have required space on your EEPROM. – dceccon Jul 19 '19 at 08:50
  • but how can you give give some example? – embbo Jul 19 '19 at 09:05
  • Ok, you need to specify more detail. Your EEPROM is under the MCU (STM32L* family) or external? If it's external, how you communicate with them? – dceccon Jul 19 '19 at 09:07
  • Please [edit] your question and tell more details about what you want to do. Do you want to store the certificate at run time (after calculating or somehow receiving it)? Do you want to store the certificate as part of the software flash process? – Bodo Jul 19 '19 at 09:21

1 Answers1

-1

ST offer an HAL library for manage the R/W on EEPROM. If you want to use this tool, you can found all details on project link X-CUBE-EEPROM and EEPROM emulation techniques and software for STM32L4 and STM32L4+ Series microcontrollers.

If you prefer to write yourself the R/W functions, you can found a good start point at ST community forum: EEPROM read/write.

A little note: when you try to find some reference about STM32 EEPROM inside MCU package, many, many, many time you can found for STM32L* family. Don't worry, the porting to another MCU is very easy.

dceccon
  • 423
  • 1
  • 7
  • 25
  • Using that library to write cerficicates and keys, which essentially are byte buffers, is going to be very annoying and inefficient. This library allows to only write 8, 16 or 32 bit values and does the EEPROM emulation by introducing additional 16bit field for each value that you store. – J_S Jul 19 '19 at 16:00
  • but How can I write that certificate to eeprom, I know "Json" but is there any specific way to write key.der or cer.der ? – embbo Jul 22 '19 at 10:17