User Tools

Site Tools


manual:demos:nucleo_l152re_cubeide

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
manual:demos:nucleo_l152re_cubeide [2022/07/30 11:47]
voorburg
manual:demos:nucleo_l152re_cubeide [2024/02/15 13:18]
voorburg [EEPROM memory device support]
Line 3: Line 3:
 ===== Supported firmware update interfaces ===== ===== Supported firmware update interfaces =====
  
-^ RS232          ^ CAN             ​^ USB          ^ TCP/​IP ​      ​^ SD-card ​     ^ +^ RS232         ​^ CAN            ^ USB         ​^ TCP/​IP ​     ^ SD-card ​     ​^ Modbus RTU   
-| Yes            | No              | No           ​| No           | No           |+| Yes           ​| No             ​| No          | No          ​| No           | No           |
  
 ===== Development Environment ===== ===== Development Environment =====
Line 43: Line 43:
 Alternatively,​ you can use your favorite programmer to flash the bootloader using one of the following files, depending on what file type your programmer supports: Alternatively,​ you can use your favorite programmer to flash the bootloader using one of the following files, depending on what file type your programmer supports:
  
-  * \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Boot**\Debug\**openblt_nucleo_stm32l152re.elf** +  * \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Boot**\Debug\**openblt_stm32l152.elf** 
-  * \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Boot**\Debug\**openblt_nucleo_stm32l152re.srec**+  * \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Boot**\Debug\**openblt_stm32l152.srec**
  
 ===== Building the Demo Program ===== ===== Building the Demo Program =====
Line 54: Line 54:
 The output file is The output file is
  
-  * \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Prog**\Debug\**demoprog_nucleo_stm32l152re.srec**+  * \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Prog**\Debug\**demoprog_stm32l152.srec**
  
 ===== Firmware update procedure ===== ===== Firmware update procedure =====
  
-To download the demo program \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Prog**\Debug\**demoprog_nucleo_stm32l152re.srec** using the bootloader, follow the instructions in the following links, depending on the communication interface you intend to use:+To download the demo program \Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\**Prog**\Debug\**demoprog_stm32l152.srec** using the bootloader, follow the instructions in the following links, depending on the communication interface you intend to use:
  
   * [[manual:​rs232_demo|Firmware updates using the RS232 communication interface]]   * [[manual:​rs232_demo|Firmware updates using the RS232 communication interface]]
  
-===== Notes ===== +===== EEPROM memory device support ​===== 
-For the demo bootloader ​and user program ​to function properlymake sure to only use compiler optimization ​**-Og** or **-O0**.+ 
 +This demo bootloader ​showcases how to enable and implement support for an additional memory device. Specificallythe 16kb internal data EEPROM of the STM32L152RE. 
 + 
 +Support for the additional memory device in the OpenBLT bootloader was enabled by setting the ''​BOOT_NVM_HOOKS_ENABLE''​ configuration macro to ''​1''​ in "​blt_conf.h":​ 
 + 
 +<code c> 
 +/** \brief Enable/​disable the NVM hook function for supporting additional memory devices. */ 
 +#define BOOT_NVM_HOOKS_ENABLE ​          (1) 
 +</​code>​ 
 + 
 +Once enabled, this results in the following hook-functions in "​hooks.c"​ being called during the firmware update: 
 + 
 +  ​''​NvmInitHook()''​ 
 +  ​''​NvmWriteHook()''​ 
 +  ​''​NvmEraseHook()''​ 
 +  ​''​NvmDoneHook()''​ 
 + 
 +The actual low-level driver for operating on the internal data EEPROM is located in the files ''​memdrv.c''​ and ''​memdrv.h''​. The implementation of the before mentioned hook-functions is such that it glues it to the functions in this low-level driver. 
 + 
 +For testing purposes an extra S-record file was generated that contains random data, mapped to a location in the internal data EEPROM: 
 + 
 +  ​\Target\Demo\ARMCM3_STM32L1_Nucleo_L152RE_CubeIDE\Prog\Debug\eeprom_data.srec 
 +     
 +If you select this S-record file when starting a firmware update, its data contents will be stored in the STM32L152RE'​s internal data EEPROM. 
 + 
 +Note that this S-record file with random data was generated with the ''​srec_cat''​ [[https://​srecord.sourceforge.net/​|tool]]:​ 
 + 
 +<​code>​ 
 +srec_cat -generator 0x08080000 0x08080400 -repeat-data 0x00 -exclude 0x08080000 0x08080400 \ 
 +         ​-random-fill 0x08080000 0x08080400 -o eeprom_data.srec -Motorola 
 +</​code> ​   
 + 
  
  
  
manual/demos/nucleo_l152re_cubeide.txt · Last modified: 2024/02/15 14:30 by voorburg