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

docs: provide instructions for flashing with OpenOCD / BMDA; provide instructions for non-autodetect TTYs #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jwise
Copy link

@jwise jwise commented Feb 14, 2025

For those of us without J-Links, and on Macs where the ancient version of PyFtdi misbehaves, we provide instructions for using OpenOCD (or BMDA) as a flash tool.

…instructions for non-autodetect TTYs

Signed-off-by: Joshua Wise <joshua@accelerated.tech>
@jwise jwise requested review from Hexxeh and gmarull February 14, 2025 08:27
Copy link

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

Since OpenOCD seems to be supported as a core feature, this should be integrated with ./waf flash (waftools/openocd.py, main wscript). Flashing definitely needs some love to be multirunner capable (as there are better options than OpenOCD nowadays), similar to Zephyr.

Just tested this locally and it works without invoking any GDB:

# myconfig.cfg
set WORKAREASIZE 0x4000
source [find interface/jlink.cfg]
transport select swd
source [find target/nrf52.cfg]
openocd -f myconfig.cfg -c "init;targets;reset init;flash write_image erase my.hex;reset run;shutdown"

First make sure Nordic S140 Softdevice is flashed (only do this once):

```shell
arm-none-eabi-gdb -ex 'target extended-remote localhost:3333' -ex 'load src/fw/vendor/nrf5-sdk/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex' -ex exit
Copy link

Choose a reason for hiding this comment

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

OpenOCD alone can take care of flashing, reset, etc. Adding gdb seems unnecessary.

@jwise
Copy link
Author

jwise commented Feb 19, 2025

I think I want to wait to integrate with ./waf flash until we have a bootloader -- we could make waf flash flash it on nRF52 for now, but it seems reasonable that it's a fairly manual process at the moment.

I guess you could do this without gdb. But basically any time you flash the system at this point you want to do it with a debugger connected :)

Should we merge this for now, and then revisit later once asterix stabilizes?

@gmarull
Copy link

gmarull commented Feb 19, 2025

I think I want to wait to integrate with ./waf flash until we have a bootloader -- we could make waf flash flash it on nRF52 for now, but it seems reasonable that it's a fairly manual process at the moment.

I guess you could do this without gdb. But basically any time you flash the system at this point you want to do it with a debugger connected :)

Should we merge this for now, and then revisit later once asterix stabilizes?

I prefer to keep gdb out of the game as it's not strictly required. It can be manual, but just with openocd, see my snippet above.

@gmarull
Copy link

gmarull commented Feb 25, 2025

@jwise ./waf flash_fw should work out of the box now, so this PR can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants