1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

308 Commits

Author SHA1 Message Date
mguetschow
d86738f057
Merge pull request #20970 from crasbe/pr/nRF_OpenOCD
cpu/nRF52: Always recover Device before Flashing
2024-11-11 08:29:41 +00:00
crasbe
5d7194a4ee makefiles: introduce OPENOCD_POST_INIT_CMDS 2024-11-08 16:03:17 +01:00
Marian Buschsieweke
fdac725d8c
makefiles/serial: better MOST_RECENT_PORT=1 for CDC ACM
- Allow specifying an alternative board filter for the bootloader TTY,
  as this will present different vendor, model, and serial than RIOT's
  USB implementation.
- Allow specifying the serial. This is useful when multiple CDC ACM
  devices are present.
2024-11-05 13:21:16 +01:00
benpicco
db21bd134f
Merge pull request #20121 from benpicco/pyterm-session
makefiles/tools/serial.inc.mk: make use of pyterm session names
2024-07-11 15:48:42 +00:00
crasbe
1261e03a5e makesfiles/jlink: fix exports for flashing 2024-07-06 19:27:29 +02:00
Marian Buschsieweke
42b68a5a43
Merge pull request #20504 from MrKevinWeiss/pr/feather-nrf52840-sense/generic
driver/lsm6dsxx: Allow generic LSM6DSXX driver
2024-03-27 16:32:47 +00:00
Benjamin Valentin
3c78c3d8ac tools/openocd: define SWD_EN signal for tigard 2024-03-26 18:42:43 +01:00
MrKevinWeiss
1fcc34d119
makefiles/tools/usb_board_reset.mk: Add test-with-config to deps 2024-03-26 18:13:20 +01:00
Marian Buschsieweke
aafc099a1c
dist/tools/mspdebug: build from source
This adds mspdebug as package, similar to EDBG, so that the
programmer/debugger is build from source.

This has the advantage that we can indeed provide patches of our own.
The first patch fixes a bug with the CPU detection of `mspdebug` in
combination with the Olimex MSP430-JTAG-TINY-V2. The second adds the
`--expect-id <CPU_NAME>` argument.

The RIOT integration is updated to directly make use of the
`--expect-id` parameter. No more spending time debugging why firmware
the firmware for the `olimex-msp430-h2618` doesn't run when flashed on
the `olimex-msp430h1611` hardware :D
2024-02-06 15:23:02 +01:00
Benjamin Valentin
59bb957c84 makefiles/tools/serial.inc.mk: pyterm: log to /tmp by default 2024-01-29 11:09:26 +01:00
Marian Buschsieweke
93aa9e1e0d
makefiles/tools/serial.inc.mk: Improve MOST_RECENT_PORT=1 handling
When `stdio_cdc_acm` is used, prefer selecting the USB devices with
vendor `RIOT-os.org` and model `$(BOARD)` and only fall back
to `$(TTY_BOARD_FILTER)` if no such TTY was found.

This makes it possible to add a TTY board filter matching only an
integrated USB to UART bridge, but still do the right thing when
the user explicitly uses `stdio_cdc_acm` instead of the default
`stdio_uart`.
2024-01-17 21:58:56 +01:00
Marian Buschsieweke
d674b3a80c
makefiles/tools/openocd.inc.mk: Improve transport handling
Allow setting `OPENOCD_TRANSPORT` to `default` for when a transport to
not explicitly set the transport. This is useful when the target or
interface script already specify the transport.
2024-01-17 09:14:38 +01:00
Oleg Hahm
2b779fc5a9 native: only set TERMFLAGS for pyterm
If TERMPROG is unset the default is pyterm. If TERMPROG is pyterm we
need to set the native flag.
2023-12-18 13:44:20 +01:00
Benjamin Valentin
2933bbce56 makefiles/tools/serial.inc.mk: make use of pyterm session names 2023-11-29 20:21:06 +01:00
d296babbc8
makefiles/usb_board_reset.mk: declare term-delay target with test target 2023-08-11 17:53:10 +02:00
bors[bot]
829af7c105
Merge #19703 #19724 #19735
19703: cpu/sam0_eth: interrupt based link detection/auto-negotiation r=benpicco a=benpicco



19724: dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable r=benpicco a=fabian18



19735: nrf5x_common: Clear I2C periph shorts r=benpicco a=bergzand

### Contribution description

The I2C peripheral's shortcuts are used with the read and write register to automatically stop the I2C transaction or to continue with the next stage.

With simple I2C read and write bytes these shorts are not used, but are also not cleared by the function in all cases, causing it to use the shortcut configuration set by a previous function call. This patch ensures that the shorts are always set by the read and write functions

### Testing procedure

Should be possible to spot with a logic analyzer and the I2C periph test. Maybe the HIL test can also detect it :)

### Issues/PRs references

None

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-06-14 12:34:33 +00:00
Fabian Hüßler
17d0e586c5 dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable 2023-06-13 21:04:27 +02:00
Fabian Hüßler
c76a192eb8 openocd: support target debug-client 2023-06-10 01:03:30 +02:00
bors[bot]
993c10a2a2
Merge #19556 #19662
19556: tools/mspdebug: fix `make debug` and `make debugserver` r=aabadie a=maribu

### Contribution description

The semantics of `make debug` and `make debugserver` have changed in the years since the MSP430 integration. This brings the implementation back into line with the current semantics

- `make debug` now starts both mspdebug and GDB, no need to run `make debugserver` prior to `make debug` anymore
- `make debug` no longer flashes the target to not waste flash erase cycles
- GDB mutliarch support is added
- support for selecting a debug adapter by its serial is added


19662: driver/lc709203f: remove unnecessary use of float r=aabadie a=kfessel

### Contribution description

removes a unnecessary use of float

### Testing procedure

read and test if you got that hardware (I don't)

### Issues/PRs references

#19614 

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-05-24 15:54:23 +00:00
Marian Buschsieweke
ca15b1e1f8
tools/mspdebug: fix make debug and make debugserver
The semantics of `make debug` and `make debugserver` have changed in
the years since the MSP430 integration. This brings the implementation
back into line with the current semantics

- `make debug` now starts both mspdebug and GDB, no need to
  run `make debugserver` prior to `make debug` anymore
- `make debug` no longer flashes the target to not waste flash erase
  cycles
- GDB mutliarch support is added
- support for selecting a debug adapter by its serial is added
2023-05-24 17:00:38 +02:00
bors[bot]
f3150120f7
Merge #17425
17425: cpu/rpx0xx: initial PIO support r=maribu a=fabian18



Co-authored-by: Fabian Hüßler <fabian.huessler@st.ovgu.de>
2023-05-23 07:02:45 +00:00
f25731e88a
make/usb_board_reset: define {preflash,term}-delay when necessary 2023-05-18 21:41:54 +02:00
Fabian Hüßler
cea57ef1f2 tools/pioasm: Add PIO assembler pioasm 2023-05-12 23:03:05 +02:00
Marian Buschsieweke
63d535e21d
makefiles/tools/jlink.inc.mk: use ELF file for flashing
There seems to be a consensus to go for a more ELF centric approach
whenever possible. J-Link seems to work fine with ELF files, so let's
avoid the extra step to create a bin file from the ELF file prior to
flashing.
2023-05-03 15:32:17 +02:00
Marian Buschsieweke
f220c23c20
tools/openocd: Fix handling of OPENOCD_CMD_RESET_HALT
The OPENOCD_CMD_RESET_HALT was not longer correctly passed to the
script. This fixes the issue.
2023-04-25 15:59:30 +02:00
MrKevinWeiss
6d729033e5
makefiles/tools/serial.inc.mk: Handle new miniterm versions
While testing examples/micropython I notice that the default of miniterm.py is actually miniterm.
To simplify user setups, this checks for miniterm.py first then falls back to miniterm.
2023-04-04 12:47:54 +02:00
7ab8d6100c
tools/renode: add support for target reset 2023-03-10 10:39:49 +01:00
Marian Buschsieweke
015ee050f2
makefiles/tools/serial.inc.mk: Allow detection of debug adapter
Boards with an integrated debugger/programmer that also provides the
serial as UART <--> USB adapter, the TTY serial matches the serial of
the programmer.

This adapts the `serial.inc.mk` to set the `DEBUG_ADAPTER_ID` to the
TTY serial if (and only if) `MOST_RECENT_PORT` *and*
`DEBUG_ADAPTER_ID_IS_TTY_SERIAL` both have a value of `1`. Boards with
an integrated programmer are expected to set
`DEBUG_ADAPTER_ID_IS_TTY_SERIAL` to `1` in their `Makefile.include`.
2023-02-24 16:50:56 +01:00
Marian Buschsieweke
3e1dcf31cb
tools/openocd: Allow specifying a custom halt command
Typically, OpenOCD is already performing a reset on connect. A
`reset halt` to bring the target to a `halt` state for flashing will
result in the device going through a second reset cycle. This can be
problematic with some device, such as the CC26xx MCUs. For these
devices, an `OPENOCD_CMD_RESET_HALT := -c 'halt'` will avoid the second
reset that is causing the issues.
2023-01-10 21:59:56 +01:00
Marian Buschsieweke
7bb5232792
makefiles/tools/openocd-adapters: add XDS110 support
This adds the configuration to allow choosing the XDS110 used in
cc13xx-launchpad and cc26xx-launchpad boards via the
`OPENOCD_DEBUG_ADAPTER` variable.
2023-01-10 21:58:19 +01:00
bors[bot]
f7ef90d213
Merge #19074
19074: cpu/esp8266: build the SDK bootloader from source r=benpicco a=gschorcht

### Contribution description

This PR is a takeover of PR #17043, which is rebased to the current master and includes some corrections that became necessary after rebasing.

**Copied from description of PR #17043:**

We had four versions of pre-built bootloaders for the esp8266 with different settings of logging and color logging. These bootloaders were manually built from the SDK and shipped with RIOT-OS source code. However there are more settings that affect the bootloader build that are relevant to the app or final board that uses this bootloader. In particular, flash size and flash speed is important for the bootloader to be able to load an app from a large partition table at the fastest speed supported by the board layout and flash chip.

Another example is the UART baudrate of the logging output from the bootloader. The boot ROM will normally start at a baud rate of 74880 (depending on the crystal installed), so it might make sense to keep the UART output at the same speed so we can debug boot modes and bootloader with the same terminal.

This patch builds the `bootloader.bin` file from the ESP8266 SDK source code. The code is built as a module (`esp8266_bootloader`) which at the moment doesn't generate any object code for the application and only produces a `bootloader.bin` file set to the `BOOTLOADER_BIN` make variable for the `esptool.inc.mk` to flash.

The code needs to be compiled and linked with custom rules defined in the module's Makefile since the `bootloader.bin` is its own separate application.

The `BOOTLOADER_BIN` variable is changed from a path relative to the `$(RIOTCPU)/$(CPU)/bin/` directory to be full path. This makes it easier for applications or board to provide their own bootloader binary if needed.

As a result of building the bootloader from source we fixed the issue of having a large partition table.

### Testing procedure

Use following command to flash the application with STDIO UART baudrate of 115200 baud.
```
BAUD=74880 USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```
Connect with a terminal programm of your choice (unfortunatly `picocom` and `socat` don't support a baudrate close to 74880), for example:
```
python -m serial.tools.miniterm /dev/ttyUSB0 74880
```
On reset, the `esp8266-esp-12x` node shows the ROM bootloader log output
```
 ets Jan  8 2013,rst cause:2, boot mode:(3,7) 

load 0x40100000, len 6152, room 16 
tail 8
chksum 0x6f
load 0x3ffe8008, len 24, room 0 
tail 8
chksum 0x86
load 0x3ffe8020, len 3408, room 0 
tail 0
chksum 0x79
```
as well as the second-stage bootloader built by this PR (`ESP-IDF v3.1-51-g913a06a9ac3`) at 74880 baudrate.
```
I (42) boot: ESP-IDF v3.1-51-g913a06a9ac3 2nd stage bootloader
I (42) boot: compile time 11:25:03
I (42) boot: SPI Speed      : 26.7MHz
...
I (151) boot: Loaded app from partition at offset 0x10000
```
The application output is seen as garbage since the `esp8266-esp-12x` uses 115200 as baurate by default.

To see all output at a baudrate of 74880 baud, you can use the following command:
```
CFLAGS='-DSTDIO_UART_BAUDRATE=74880' BAUD=74880 USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```

If the application is built without options, the ROOM bootloader output will be 74880 baud and the second stage bootloader and application output will be 115200 baud.

### Issues/PRs references

Fixes issue #16402

Co-authored-by: iosabi <iosabi@protonmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-03 00:44:24 +00:00
Gunar Schorcht
a71f457f23 makefile/tools/esptool.inc.mk: fix esp-qemu dependency 2022-12-31 14:10:57 +01:00
Gunar Schorcht
f23b20f91f cpu/esp: use FLASHFILE_POS for image position in flash
Instead of using a fixed position of the image file in the flash, the variable `FLASHFILE_POS` is used which allows to override the default position of the image in the flash at 0x10000.
2022-12-31 14:10:57 +01:00
iosabi
073b2209da cpu/esp8266: Build the SDK bootloader from source.
We had four versions of pre-built bootloaders for the esp8266 with
different settings of logging and color logging. These bootloaders were
manually built from the SDK and shipped with RIOT-OS source code.
However there are more settings that affect the bootloader build that
are relevant to the app or final board that uses this bootloader. In
particular, flash size and flash speed is important for the bootloader
to be able to load an app from a large partition table at the fastest
speed supported by the board layout and flash chip.

Another example is the UART baudrate of the logging output from the
bootloader. The boot ROM will normally start at a baud rate of 74880
(depending on the crystal installed), so it might make sense to keep
the UART output at the same speed so we can debug boot modes and
bootloader with the same terminal.

This patch builds the bootloader.bin file from the ESP8266 SDK source
code. The code is built as a module (esp8266_bootloader) which at the
moment doesn't generate any object code for the application and only
produces a bootloader.bin file set to the BOOTLOADER_BIN make variable
for the esptool.inc.mk to flash.

The code needs to be compiled and linked with custom rules defined in
the module's Makefile since the bootloader.bin is its own separate
application.

The `BOOTLOADER_BIN` variable is changed from a path relative to the
`$(RIOTCPU)/$(CPU)/bin/` directory to be full path. This makes it easier
for applications or board to provide their own bootloader binary if
needed.

As a result of building the bootloader from source we fixed the issue of
having a large partition table. Fixes #16402.
2022-12-22 12:18:34 +01:00
Marian Buschsieweke
208bf7eef3
build system: improve MOST_RECENT_PORT=1 handling
Allow overriding the shell command used to auto-detect the TTY of a
board with `MOST_RECENT_PORT=1` via the `TTY_SELECT_CMD` variable.
The use case is to also detect Arduino Mega 2560 clones with cheap
USB UART bridges (for which the filter command may yield false
positives) while preferring genuine Arduino Mega 2560 boards (if
found) over the clones (as the filter for genuine boards does not yield
false positives).
2022-12-11 18:58:18 +01:00
Marian Buschsieweke
b9b63da984
makefiles/tools/gdb.inc.mk: prefer $(target)-gdb over gdb-multiarch
In an ideal world everyone would just install `gdb-multiarch` and be
happy. However, some MCUs need magic GDB versions sprinkled with
unicorn-stardust-Espressif-patches...

Since there is little reason to have `$(target)-gdb` installed in
addition to `gdb-multiarch` if `gdb-multiarch` would work fine, let's
assume the user wants to use `$(target)-gdb` when present over
`gdb-multiarch`.

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2022-10-24 09:24:24 +02:00
Benjamin Valentin
2625f58774 makefiles/tools/serial.inc.mk: add support for bootterm 2022-10-15 00:20:09 +02:00
MrKevinWeiss
6cad5d2477
cpu/mips: Remove all mips 2022-09-27 13:42:37 +02:00
Marian Buschsieweke
d6a9e5b590
Merge pull request #18628 from benpicco/openocd-adapters-ftdi
tools/openocd: add generic FTDI adapter
2022-09-23 23:58:30 +02:00
Marian Buschsieweke
7df2bc2072
tools/avarice: deduce debugger from AVRDUDE_PROGRAMMER
If `AVRDUDE_PROGRAMMER` is already set to a programmer that is also
capable of debugging, we can assume that typically the user will want
to use the same hardware for debugging. Thus, let `AVR_DEBUGDEVICE`
default to the matching hardware.
2022-09-23 13:41:27 +02:00
Benjamin Valentin
f80b4557fd tools/openocd: add generic FTDI adapter 2022-09-22 17:49:34 +02:00
chrysn
6cfe240812 makefiles: Select suitable terminal when stdio_rtt is used
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2022-08-30 10:51:59 +02:00
chrysn
2c9e853aae
Merge pull request #18526 from chrysn-pull-requests/openocd-rtt
makefiles: Add openocd-rtt
2022-08-30 09:44:50 +02:00
chrysn
62a6d3c128 makefiles: Add openocd-rtt
JLink presumably has information about the device's RAM available
internally. Not passing the precise symbol area (which would be
available in the ELF file) because a) that'd make the terminal break
when the flashed firmware does not equal the built one, and b) that
would introduce a dependency from `term` to the ELF file that other
terminals don't have.
2022-08-30 09:34:22 +02:00
Marian Buschsieweke
78de9a3f53
makefiles/tools/serial.inc.mk: Improve PORT selection
When `stdio_cdc_acm` is used, assume `"RIOT-os\.org"` as vendor string
and `$(BOARD)` being used as model string. This is the default
behavior in RIOT since eaace28804
2022-08-29 16:39:25 +02:00
Dylan Laduranty
8dac70db69 makefiles/tools/dfu-util: add option to pass DFU_SERIAL
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2022-08-29 09:39:15 +02:00
MrKevinWeiss
0489630aa7
makefiles: quiet messages on CI
After introducing #18423 there are occasional messages that still happen.
These messages cause a diff output when testing with TEST_KCONFIG=1.
This then causes a failure when comparing make/kconfig modules and packages.
2022-08-22 11:35:56 +02:00
Gunar Schorcht
be1764043d makefile/tools/esptool: use dio instead of qout or qio flash mode
If Quad SPI modes qout or qio are set by variable FLASH_MODE, esptool.py has to be called with parameter `--flash_mode dio` so that the first stage bootloader is always using Dual SPI mode.
2022-08-01 15:08:41 +02:00
Gunar Schorcht
b6dc652d1d makefiles/tools/esptool.mk: inverse CPU* conditionals
The CPU* conditionals are inverted so that they can be tested for ESP8266. In all other cases the MCU is any ESP32x SoC
2022-06-23 12:56:56 +02:00
Marian Buschsieweke
e706468a5a
makefiles/tools/serial.inc.mk: Use TTY_BOARD_FILTER
When `MOST_RECENT_PORT` is set to `1`, the most recently added USB
serial is selected. This is a crude but surprisingly effective filter.
However, for the CC2560-Launchpad this doesn't work, as it provides
two USB serials. The first USB serial interface is the targeted UART
bridge and the second controls the debugger. Since the second is added
a tiny fraction after the first, this reliably selects the wrong
interface. Allowing the board to filter USB serials first can avoid
this issue.

This is also useful as e.g. an STM Nucleo board can easily be told
apart from an `samr21-xpro` or an nRF52840dk using such filters.
2022-06-03 19:59:30 +02:00