Skip to content

Custom RAM Functions

Georg Icking-Konert edited this page Dec 13, 2020 · 2 revisions

A custom RAM function can be uploaded via bootloader and executed via BL "GO" command. Please consider the following details:

  • all ROM-BL versions use the lowest 512B in RAM (0x00..0x1FF), see 3.8.1 in UM0560 rev.10
  • the ROM-BL clears 0x00..0x1FF prior to executing "GO" -> custom code must be located >=0x200
  • alternatively, erase()/write() RAM functions can be replaced for STM8S and STM8AF (not STM8L and STM8AL, as these automatically upload erase() & write() from ROM). Details:
    • erase() replacement:
      • stored at 0xa0 (see UM0560)
      • parameters are passed between ROM-BL and erase() via fixed addresses. Details are not documented and tbd
    • write() replacement:
      • stored at 0x180 (64..128kB) or 0x150 (32kB). Info from disassembly of ST RAM routines
      • parameters are passed between ROM-BL and erase() via fixed addresses. Details are not documented and tbd
Clone this wiki locally