[riot-notifications] [RIOT-OS/RIOT] bin (#11179)

Francisco notifications at github.com
Thu Mar 14 11:25:16 CET 2019


<!--
====================================
IF YOUR ISSUE IS RELATED TO SECURITY
====================================
please submit it to the security mailing-list security at riot-os.org.

If your issue is a question related to the usage of RIOT, please submit it to
the user mailing-list users at riot-os.org or to the developer mailing-list
devel at riot-os.org.
-->

#### Description
<!--
Example: Cannot build gnrc_networking application for samr21-xpro board.
-->

When working on supporting riotboot on other boards (in this case nucleo-l1476rg) I came across a problem which @cladmi pointed out in #11141. When the base address for the flash is not defined in the openocd configuration file it attemps to flashes at address 0x0000000 and not 0x080000000

https://github.com/RIOT-OS/RIOT/blob/8969fd32e90f0ad8e2781e89170d4fd3ef146947/dist/tools/openocd/openocd.sh#L200-L208

https://github.com/gnu-mcu-eclipse/openocd/blob/4a6f93c96146f3c06e61d89377d76e84915af202/tcl/target/stm32f3x.cfg#L63-L64

This results in a failure to write. Openocd doesn't define the base address in its config files because it usually probes the device before flashing getting back the amount of flash, banks, sizes and starting addresses. But the absence of this triggers a bug with us. I'm not sure if this should be handled by modifying our opeoncd config files for these boards or the openocd.sh script.

#### Steps to reproduce the issue
<!--
Try to describe as precisely as possible here the steps required to reproduce
the issue. Here you can also describe your hardware configuration, the network
setup, etc.
-->

Add `#define CPU_FLASH_BASE                  FLASH_BASE` in cpu_conf.h for stm32l4 and attempt to run the riotboot test

`BOARD=nucleo-l476rg APP_VER=$(date +%s) make -C tests/riotboot/ riotboot/flash`
#### Expected results
<!--
Example: The gnrc_networking application builds on samr21-xpro.
-->

No error at compile time.

#### Actual results
<!--
Please paste or specifically describe the actual output.
-->

`### Flashing Target ###`
`Binfile detected, adding ROM base address: 0x00000000`
`Flashing with IMAGE_OFFSET: 0x00001000`
`Open On-Chip Debugger 0.10.0+dev-00704-gdb429c34 (2019-03-08-12:14)`
`Licensed under GNU GPL v2`
`For bug reports, read`
`        http://openocd.org/doc/doxygen/bugs.html`
`WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg`
`hla_swd`
`Warn : Interface already configured, ignoring`
`Error: already specified hl_layout stlink`
`Warn : Transport "hla_swd" was already selected`
`Info : The selected transport took over low-level target control. The results might differ compared to plain` `JTAG/SWD`
`adapter speed: 500 kHz`
`adapter_nsrst_delay: 100`
`none separate`
`srst_only separate srst_nogate srst_open_drain connect_deassert_srst`
`Info : clock speed 500 kHz`
`Info : STLINK V2J28M18 (API v2) VID:PID 0483:374B`
`Info : Target voltage: 3.244649`
`Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints`
`Info : Listening on port 33105 for gdb connections`
`    TargetName         Type       Endian TapName            State`       
`--  ------------------ ---------- ------ ------------------ ------------`
` 0* stm32l4x.cpu       hla_target little stm32l4x.cpu       halted`
`Info : Unable to match requested speed 500 kHz, using 480 kHz`
`Info : Unable to match requested speed 500 kHz, using 480 kHz`
`adapter speed: 480 kHz`
`target halted due to debug-request, current mode: Thread `
`xPSR: 0x01000000 pc: 0x080004cc msp: 0x20000200`
`auto erase enabled`
`Info : device id = 0x10076415`
`Info : flash size = 1024kbytes`
`Warn : no flash bank found for address 0x00001000`
`wrote 0 bytes from file /home/francisco/workspace/RIOT/tests/riotboot/bin/nucleo-l476rg/tests_riotbootslot0.riot.bin in 0.002664s (0.000 KiB/s)`
`Error: checksum mismatch - attempting binary compare`
`diff 0 address 0x00001000. Was 0x78 instead of 0x52`
`diff 1 address 0x00001001. Was 0x40 instead of 0x49`
`diff 2 address 0x00001002. Was 0x00 instead of 0x4f`
`diff 3 address 0x00001003. Was 0x08 instead of 0x54`
`diff 4 address 0x00001004. Was 0x24 instead of 0x99`
`diff 5 address 0x00001005. Was 0x02 instead of 0x26`
`diff 6 address 0x00001006. Was 0x00 instead of 0x8a`

#### Versions
Operating System Environment
-----------------------------
       Operating System: "Ubuntu" "18.04.2 LTS (Bionic Beaver)"
                 Kernel: Linux 4.18.0-16-generic x86_64 x86_64

Installed compiler toolchains
-----------------------------
             native gcc: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
      arm-none-eabi-gcc: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
                avr-gcc: missing
       mips-mti-elf-gcc: missing
             msp430-gcc: missing
   riscv-none-embed-gcc: missing
   xtensa-esp32-elf-gcc: missing
   xtensa-lx106-elf-gcc: missing
                  clang: missing

Installed compiler libs
-----------------------
   arm-none-eabi-newlib: "2.5.0"
    mips-mti-elf-newlib: missing
riscv-none-embed-newlib: missing
xtensa-esp32-elf-newlib: missing
xtensa-lx106-elf-newlib: missing
               avr-libc: missing (missing)

Installed development tools
---------------------------
                  cmake: cmake version 3.14.0-rc3
               cppcheck: Cppcheck 1.82
                doxygen: missing
                 flake8: 3.7.7 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.6.7 on Linux
                    git: git version 2.21.0
                   make: GNU Make 4.1
                openocd: Open On-Chip Debugger 0.10.0+dev-00704-gdb429c34 (2019-03-08-12:14)
                 python: Python 3.6.7
                python2: Python 2.7.15rc1
                python3: Python 3.6.7
             coccinelle: missin

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11179
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190314/ecbf9084/attachment.html>


More information about the notifications mailing list