Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

stm32l1/vendor: update vendor files to v2.3.0 #11489

Merged
merged 2 commits into from
Aug 5, 2019

Conversation

fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas commented May 6, 2019

Contribution description

This PR updates stm32l1xx CMSIS header files to v2.3.0.

The following changes here made to the original Header files:

Testing procedure

Run all tests for nucleo-l152re or other stm32l1 based boards.

python dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --jobs 0 . nucleo-l152re

Issues/PRs references

Depends on #11830.

@fjmolinas fjmolinas requested a review from aabadie May 6, 2019 07:17
@fjmolinas fjmolinas added Area: cpu Area: CPU/MCU ports Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels May 6, 2019
@fjmolinas fjmolinas requested a review from vincent-d May 6, 2019 13:43
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 8, 2019
@fjmolinas fjmolinas force-pushed the pr-update_stm32l1-cmsis branch from cb179dc to c43091b Compare May 13, 2019 08:02
@fjmolinas
Copy link
Contributor Author

@aabadie split in two commits following your offline comments!

@aabadie
Copy link
Contributor

aabadie commented May 13, 2019

I ran python3 dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --jobs 4 . nucleo-l152re and there are problems with the ISR stack size apparently. A lot of tests are failing, for example with test_usleep_short I have the following:

python3 ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . nucleo-l152re --jobs=4 --applications="tests/xtimer_usleep_short"
INFO:nucleo-l152re:Saving toolchain
INFO:nucleo-l152re.tests/xtimer_usleep_short:Board supported: True
INFO:nucleo-l152re.tests/xtimer_usleep_short:Board has enough memory: True
INFO:nucleo-l152re.tests/xtimer_usleep_short:Run compilation
INFO:nucleo-l152re.tests/xtimer_usleep_short:Run test
INFO:nucleo-l152re.tests/xtimer_usleep_short:Run test.flash
WARNING:nucleo-l152re.tests/xtimer_usleep_short:make RIOT_CI_BUILD=1 CC_NOCOLOR=1 --no-print-directory -C ./tests/xtimer_usleep_short test
/home/aabadie/softs/src/riot/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2019-05-13 11:16:18,988 - INFO # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2019-05-13 11:16:21,121 - INFO # 
2019-05-13 11:16:21,122 - INFO # Context before hardfault:
2019-05-13 11:16:21,127 - INFO #    r0: 0x00000001
2019-05-13 11:16:21,128 - INFO #    r1: 0x00000001
2019-05-13 11:16:21,128 - INFO #    r2: 0x08000401
2019-05-13 11:16:21,129 - INFO #    r3: 0x00000010
2019-05-13 11:16:21,133 - INFO #   r12: 0x00000000
2019-05-13 11:16:21,133 - INFO #    lr: 0x0800065f
2019-05-13 11:16:21,133 - INFO #    pc: 0x07822d5e
2019-05-13 11:16:21,139 - INFO #   psr: 0x61000000
2019-05-13 11:16:21,139 - INFO # 
2019-05-13 11:16:21,139 - INFO # FSR/FAR:
2019-05-13 11:16:21,139 - INFO #  CFSR: 0x00000100
2019-05-13 11:16:21,139 - INFO #  HFSR: 0x40000000
2019-05-13 11:16:21,140 - INFO #  DFSR: 0x00000008
2019-05-13 11:16:21,145 - INFO #  AFSR: 0x00000000
2019-05-13 11:16:21,151 - INFO # Misc
2019-05-13 11:16:21,151 - INFO # EXC_RET: 0xfffffffd
2019-05-13 11:16:21,152 - INFO # Attempting to reconstruct state for debugging...
2019-05-13 11:16:21,152 - INFO # In GDB:
2019-05-13 11:16:21,153 - INFO #   set $pc=0x7822d5e
2019-05-13 11:16:21,153 - INFO #   frame 0
2019-05-13 11:16:21,156 - INFO #   bt
2019-05-13 11:16:21,157 - INFO # 
2019-05-13 11:16:21,158 - INFO # ISR stack overflowed by at least 16 bytes.
2019-05-13 11:16:22,046 - INFO # �main(): This is RIOT! (Version: buildtest)
2019-05-13 11:16:25,044 - INFO # 
2019-05-13 11:16:25,051 - INFO # Context before hardfault:
2019-05-13 11:16:25,052 - INFO #    r0: 0x00000001
2019-05-13 11:16:25,057 - INFO #    r1: 0x00000001
2019-05-13 11:16:25,057 - INFO #    r2: 0x08000401
2019-05-13 11:16:25,058 - INFO #    r3: 0x00000010
2019-05-13 11:16:25,058 - INFO #   r12: 0x00000000
2019-05-13 11:16:25,059 - INFO #    lr: 0x0800065f
2019-05-13 11:16:25,063 - INFO #    pc: 0x07822d5e
2019-05-13 11:16:25,063 - INFO #   psr: 0x61000000
2019-05-13 11:16:25,063 - INFO # 
2019-05-13 11:16:25,064 - INFO # FSR/FAR:
2019-05-13 11:16:25,064 - INFO #  CFSR: 0x00000100
2019-05-13 11:16:25,068 - INFO #  HFSR: 0x40000000
2019-05-13 11:16:25,069 - INFO #  DFSR: 0x00000008
2019-05-13 11:16:25,069 - INFO #  AFSR: 0x00000000
2019-05-13 11:16:25,069 - INFO # Misc
2019-05-13 11:16:25,074 - INFO # EXC_RET: 0xfffffffd
2019-05-13 11:16:25,081 - INFO # Attempting to reconstruct state for debugging...
2019-05-13 11:16:25,081 - INFO # In GDB:
2019-05-13 11:16:25,082 - INFO #   set $pc=0x7822d5e
2019-05-13 11:16:25,082 - INFO #   frame 0
2019-05-13 11:16:25,082 - INFO #   bt
2019-05-13 11:16:25,082 - INFO # 
2019-05-13 11:16:25,086 - INFO # ISR stack overflowed by at least 16 bytes.
Timeout in expect script at "child.expect(u"This test will call xtimer_usleep for values from \\d+ down to \\d+\r\n")" (tests/xtimer_usleep_short/tests/01-run.py:15)

make: *** [/home/aabadie/softs/src/riot/RIOT/tests/xtimer_usleep_short/../../Makefile.include:576: test] Error 1

Return value: 2

ERROR:nucleo-l152re.tests/xtimer_usleep_short:Error during test, writing to results/nucleo-l152re/tests/xtimer_usleep_short/test.failed
ERROR:nucleo-l152re.tests/xtimer_usleep_short:Failed during: test
ERROR:nucleo-l152re:Tests failed: 1
Failures during test:
- [tests/xtimer_usleep_short](tests/xtimer_usleep_short/test.failed)

Here is the gdb output:

Remote debugging using :3333
hard_fault_handler (sp=0x0, corrupted=8, exc_return=11, r4_to_r11_stack=0xa)
    at /home/aabadie/softs/src/riot/RIOT/cpu/cortexm_common/vectors_cortexm.c:341
341	    __BKPT(1);
(gdb) set $pc=0x7822d5e
(gdb) frame 0
#0  0x07822d5e in ?? ()
(gdb) bt
#0  0x07822d5e in ?? ()
#1  0x0800065e in irq_restore (state=1) at /home/aabadie/softs/src/riot/RIOT/cpu/cortexm_common/irq_arch.c:50
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@fjmolinas
Copy link
Contributor Author

fjmolinas commented May 16, 2019

@aabadie

I get the following failing tests which I think are all to be expected.

Doesn't have the driver so expected to fail

Needs sudo:

Needs SD-Card:

Timeouts Early:

Also fails in master:

This is fixed if removing #8518 changes or adding more NOP... (I don't trust removing it though without more arguments). The tests/applications work fine if node is connected and disconnected after flashing.... weird..
These test do pas in 2019.01-branch, the problem was added when #11158 added low-power-modes for stm32l1.

The ones you mention is passing for me, what are your toolchains? mine are:

Operating System Environment
-----------------------------
       Operating System: "Ubuntu" "16.04.2 LTS (Xenial Xerus)"
                 Kernel: Linux 4.13.0-32-generic x86_64 x86_64

Installed compiler toolchains
-----------------------------
             native gcc: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
      arm-none-eabi-gcc: arm-none-eabi-gcc (15:4.9.3+svn231177-1) 4.9.3 20150529 (prerelease)
                avr-gcc: missing
       mips-mti-elf-gcc: missing
             msp430-gcc: msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)
   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.2.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.5.1
               cppcheck: missing
                doxygen: 1.8.11
                 flake8: missing
                    git: git version 2.7.4
                   make: GNU Make 4.1
                openocd: Open On-Chip Debugger 0.10.0+dev-00166-g0e4fbfb (2017-07-05-19:14)
                 python: Python 3.6.8
                python2: Python 2.7.12
                python3: Python 3.6.8
             coccinelle: missing

@fjmolinas
Copy link
Contributor Author

@aabadie replicating with different toolchain I get your described behavior.

Operating System Environment
-----------------------------
       Operating System: "Ubuntu" "18.04.2 LTS (Bionic Beaver)"
                 Kernel: Linux 4.18.0-17-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 8-2018-q4-major) 8.2.1 20181213 (release) [gcc-8-branch revision 267074]
                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: "3.0.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: 1.8.16
                 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: missing

But If I remove optimization the problem is fixed too, so there is clearly an optimization problem that depends on gcc version, in #8518 it indicated that some optimization was going on an causing the fault, although the fact that

@fjmolinas fjmolinas force-pushed the pr-update_stm32l1-cmsis branch from c43091b to 1d54621 Compare July 9, 2019 07:09
@fjmolinas fjmolinas removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 9, 2019
@fjmolinas
Copy link
Contributor Author

The issues should be fixed with #11830.

@fjmolinas fjmolinas added the State: waiting for other PR State: The PR requires another PR to be merged first label Jul 12, 2019
@fjmolinas fjmolinas force-pushed the pr-update_stm32l1-cmsis branch 2 times, most recently from 3804f69 to c92af33 Compare July 12, 2019 13:08
- remove old header files
- fix new DMA header file macro definitions
- remove old cpu type groups (STM32L1XX_MD, STM32L1XX_MDP,
  STM32L1XX_HD, STM32L1XX_XL)
@fjmolinas fjmolinas force-pushed the pr-update_stm32l1-cmsis branch from c92af33 to e4a49f0 Compare August 5, 2019 09:13
@fjmolinas
Copy link
Contributor Author

rebased

@fjmolinas fjmolinas added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Aug 5, 2019
@fjmolinas
Copy link
Contributor Author

I launched the tests again, building in docker:

Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
- [tests/pkg_qdsa](tests/pkg_qdsa/test.failed)

@fjmolinas
Copy link
Contributor Author

This tests fails because of a timeout, when timeout=12s:

/home/francisco/workspace/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200"
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2019-08-05 14:54:55,068 - INFO # Connect to serial port /dev/ttyACM1
Welcome to pyterm!
Type '/exit' to exit.
2019-08-05 14:54:57,938 - INFO # �main(): This is RIOT! (Version: 2019.10-devel-217-gd075e-pr_fix_11820_2)
2019-08-05 14:55:08,504 - INFO # .
2019-08-05 14:55:08,505 - INFO # OK (1 tests)

make: Leaving directory '/home/francisco/workspace/RIOT/tests/pkg_qdsa'

I'll open a separate PR for this.

Failures because there is no hw:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)

Failures requires sudo:
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)

I think this is OK with the test results.

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm the test results reported by @fjmolinas. Let's merge this.

ACK

@aabadie aabadie merged commit d99879e into RIOT-OS:master Aug 5, 2019
@fjmolinas fjmolinas deleted the pr-update_stm32l1-cmsis branch August 7, 2019 15:43
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants