Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

boards/pyocd: cleanup use of export keyword #13593

Merged
merged 5 commits into from
Mar 10, 2020

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Mar 9, 2020

Contribution description

Similar to #13480 and #13567, this PR removes uses of export for variables used by PyOCD.

Testing procedure

  • Flashing/Resetting/Debugging the related boards should still work:
nrf52832-mdk
  • flash
$ PROGRAMMER=pyocd make BOARD=nrf52832-mdk -C examples/hello-world --no-print-directory flash
Building application "hello-world" for "nrf52832-mdk" with MCU "nrf52".

"make" -C /work/riot/RIOT/boards/nrf52832-mdk
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/nrf52
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/nrf52/periph
"make" -C /work/riot/RIOT/cpu/nrf5x_common
"make" -C /work/riot/RIOT/cpu/nrf5x_common/periph
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8048	    108	   2552	  10708	   29d4	/work/riot/RIOT/examples/hello-world/bin/nrf52832-mdk/hello-world.elf
/work/riot/RIOT/dist/tools/pyocd/pyocd.sh flash /work/riot/RIOT/examples/hello-world/bin/nrf52832-mdk/hello-world.hex
### Flashing Target ###
[====================] 100%
0001838:INFO:loader:Erased 8192 bytes (2 sectors), programmed 8192 bytes (2 pages), skipped 0 bytes (0 pages) at 10.89 kB/s
Done flashing
  • reset
$ PROGRAMMER=pyocd make BOARD=nrf52832-mdk -C examples/hello-world --no-print-directory reset
/work/riot/RIOT/dist/tools/pyocd/pyocd.sh reset
### Resetting Target ###
Resetting target
  • debug
PROGRAMMER=pyocd make BOARD=nrf52832-mdk -C examples/hello-world --no-print-directory debug
/work/riot/RIOT/dist/tools/pyocd/pyocd.sh debug /work/riot/RIOT/examples/hello-world/bin/nrf52832-mdk/hello-world.elf
### Starting Debugging ###
Reading symbols from /work/riot/RIOT/examples/hello-world/bin/nrf52832-mdk/hello-world.elf...
0000231:INFO:board:Target type is nrf52
0000293:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
0000347:INFO:ap:AP#0 IDR = 0x24770011 (AHB-AP var1 rev2)
0000356:INFO:ap:AP#1 IDR = 0x02880000 (proprietary)
0000358:INFO:target_nRF52:NRF52832 not in secure state
0000368:INFO:rom_table:AP#0 ROM table #0 @ 0xe00ff000 (designer=244 part=006)
0000377:INFO:rom_table:[0]<e000e000:SCS-M4 class=14 designer=43b part=00c>
0000383:INFO:rom_table:[1]<e0001000:DWT class=14 designer=43b part=002>
0000389:INFO:rom_table:[2]<e0002000:FPB class=14 designer=43b part=003>
0000395:INFO:rom_table:[3]<e0000000:ITM class=14 designer=43b part=001>
0000401:INFO:rom_table:[4]<e0040000:TPIU-M4 class=9 designer=43b part=9a1 devtype=11 archid=0000 devid=0:0:ca1>
0000407:INFO:rom_table:[5]<e0041000:ETM-M4 class=9 designer=43b part=925 devtype=13 archid=0000 devid=0:0:0>
0000410:INFO:cortex_m:CPU core #0 is Cortex-M4 r0p1
0000418:INFO:cortex_m:FPU present: FPv4-SP
0000423:INFO:dwt:4 hardware watchpoints
0000427:INFO:fpb:6 hardware breakpoints, 4 literal comparators
0000444:INFO:server:Semihost server started on port 4444
0000444:INFO:gdbserver:GDB server started on port 3333
Remote debugging using :3333
0001400:INFO:gdbserver:One client connected!
pm_set_lowest () at /work/riot/RIOT/cpu/cortexm_common/include/cpu.h:177
177	    irq_restore(state);
0001487:INFO:gdbserver:Attempting to load Argon
0001487:INFO:gdbserver:Attempting to load FreeRTOS
0001488:INFO:gdbserver:Attempting to load Zephyr
0001489:INFO:gdbserver:Attempting to load RTX5
(gdb) load
Loading section .text, size 0x1f70 lma 0x0
Loading section .relocate, size 0x6c lma 0x1f70
[====================] 100%
0005768:INFO:loader:Erased 0 bytes (0 sectors), programmed 0 bytes (0 pages), skipped 8192 bytes (2 pages) at 11.31 kB/s
Start address 0x420, load size 8156
Transfer rate: 11 KB/sec, 1359 bytes/write.
(gdb) l
172	    __WFI();
173	#if defined(CPU_MODEL_STM32L152RE)
174	    /* STM32L152RE crashes if branching to irq_restore(state). See #11830. */
175	    __set_PRIMASK(state);
176	#else
177	    irq_restore(state);
178	#endif
179	}
180	
181	/**
(gdb) quit
A debugging session is active.

	Inferior 1 [Remote target] will be detached.

Quit anyway? (y or n) EOF [assumed Y]
Detaching from program: /work/riot/RIOT/examples/hello-world/bin/nrf52832-mdk/hello-world.elf, Remote target
0013915:INFO:gdbserver:Client detached
0013916:INFO:gdbserver:Client disconnected!
Remote communication error.  Target disconnected.: Connection reset by peer.
  • Plug multiple boards and try to flash one of them based on its DEBUG_ADAPTER_ID

Issues/PRs references

Related to #10850

@aabadie aabadie added Area: build system Area: Build system Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: tools Area: Supplementary tools Area: boards Area: Board ports labels Mar 9, 2020
@aabadie aabadie requested a review from fjmolinas as a code owner March 9, 2020 08:40
@aabadie aabadie changed the title boards/pyocd: cleanup use of export keyword boards/pyocd: cleanup use of export keyword Mar 9, 2020
@fjmolinas fjmolinas self-assigned this Mar 10, 2020
Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

Nice cleanup, I do not have any of the boards ATM, maybe @bergzand can give it a test?

@bergzand
Copy link
Member

I'm still able to flash a particle-xenon board with this PR

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

@bergzand tested. Changes make sense ACK!

@fjmolinas fjmolinas merged commit 6ba6658 into RIOT-OS:master Mar 10, 2020
@aabadie aabadie deleted the pr/boards/pyocd_export_remove branch March 10, 2020 19:50
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: build system Area: Build system Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants