[riot-notifications] [RIOT-OS/RIOT] Add Riotboot support for CC2538 (#11665)

Gaëtan Harter notifications at github.com
Tue Jun 18 14:44:42 CEST 2019

cladmi commented on this pull request.

Could you please provide the test commands with debug output you have while testing for reference. I would ease reviewing :)

The whole problem you will have is with the `cca` as it currently not taken into account at all with `riotboot`. If you have more infos on how this work and how it should be handled, it would help.
The whole "memory at the end that should not be touched" is a bit tricky.

The way `riotboot/flash-slot0-extended` and `combined` works is by creating a binary with only the bootloader, truncated to its size, plus the header and slot firmware. So everything that was at the end of the memory would be removed. So I understand that currently they do not work.

For the `cca`, I am not sure how to handle it. Somehow I think we need to keep a full `flash` sector for it. Otherwise, when updating over the air, bytes nearby may need to be updated and so require erasing the whole sector when erasing memory. There is a `ROM_RESERVED` variable that was set for the arduino bootloader to describe reserved memory at the end of the rom but is currently not yet taken into account.

Could it be possible to assume it is always there on the board and RIOT should never touch it ? Or have a `flash-cca-sector` target to setup the board.
However then, the flasher will need to never erase the memory.

> @@ -23,7 +23,7 @@ RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh
 export PROGRAMMER ?= cc2538-bsl
 ifeq ($(PROGRAMMER),cc2538-bsl)
-  FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
+  FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -a $(IMAGE_OFFSET)+$(ROM_START_ADDR)

This would need to go in `FFLAGS` instead of `FLASHER`.
Also, I would prefer with somehow only adding it only if `IMAGE_OFFSET` is set. Like in https://github.com/RIOT-OS/RIOT/blob/fc9577030e44b03aa279be21b4271f6b6d247c94/makefiles/tools/edbg.inc.mk#L14-L15
Even if `cc2538-bsl.py` handles if the `-a` is just +rom_start as it does eval.

> @@ -15,13 +15,18 @@
  * @author          Hauke Petersen <hauke.petersen at fu-berlin.de>
+_rom_offset = DEFINED( _rom_offset ) ? _rom_offset : 0x0;
+_fw_rom_length = DEFINED( _fw_rom_length ) ? _fw_rom_length : _rom_length - _rom_offset;
+ASSERT((_fw_rom_length <= _rom_length - _rom_offset), "Specified firmware size does not fit in ROM");

This has now been put in common with `cortexm_rom_offset.ld` so you can reuse it


> @@ -23,7 +23,7 @@ RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh
 export PROGRAMMER ?= cc2538-bsl
 ifeq ($(PROGRAMMER),cc2538-bsl)
-  FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
+  FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py -a $(IMAGE_OFFSET)+$(ROM_START_ADDR)

How does it behave if you remove the `-e` in `FFLAGS` ?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190618/4569eed8/attachment-0001.html>

More information about the notifications mailing list