7
32
Fork
You've already forked blackmagic
23

Add ESP32-P4 support #2064

Open
orsolic wants to merge 3 commits from orsolic/esp32p4 into main
pull from: orsolic/esp32p4
merge into: blackmagic-debug:main
blackmagic-debug:main
blackmagic-debug:fix/pre-bmp-v3-cross-file-cleanup
blackmagic-debug:feature/bmda-remote-comms
blackmagic-debug:ALTracer/feature/aarch64-ident
blackmagic-debug:feature/better-meson-optimisation-handling
blackmagic-debug:feature/am335x-support
blackmagic-debug:feature/esp32-c3-support
blackmagic-debug:feature/cortex-ar-software-breakpoints
blackmagic-debug:feature/unit-testing
blackmagic-debug:feature/windows-usb-serial-interface-naming
blackmagic-debug:fix/bmp-external-spi
blackmagic-debug:ALTracer/feature/bluepillplus-platform
blackmagic-debug:ALTracer/feature/at32f43x-unrdp
blackmagic-debug:feature/const-correctness
blackmagic-debug:ALTracer/feature/fault_handlers
blackmagic-debug:ALTracer/feature/hazard3-ice40-support
blackmagic-debug:fix/ci-cleanup
blackmagic-debug:ALTracer/fix/gdb-10-12-thread
blackmagic-debug:ALTracer/feature/blackpill-f4-adc
blackmagic-debug:ALTracer/fix/cortex-desc-allocfail-report
blackmagic-debug:ALTracer/feature/spi-perf
blackmagic-debug:ALTracer/feature/calibrate_swd
blackmagic-debug:ALTracer/feature/blank-check
blackmagic-debug:feature/avr
blackmagic-debug:v2.0
blackmagic-debug:v1.9
blackmagic-debug:v1.10
blackmagic-debug:v1.8
orsolic commented 2025年01月28日 07:47:52 +01:00 (Migrated from github.com)
Copy link

Continuation of mistakenly closed #2063

Here is commit with start of support for ESP32-P4.

I have started working on flashing support but I need to shelve that plan for the time being.
I am pushing the things which seems to work - patch is rough, but more will hopefully come later.

Tested with BMA and ESP-prog (FT2232H) on FreeBSD with Waveshare ESP32-P4 board with flashed IDF example.

Works:

  • JTAG scan
  • attach to target
  • run program
  • reset
  • hardware breakpoint
  • continue
  • printing of var in SRAM
>>> p var
4ドル = 123
>>> p &var
5ドル = (uint32_t *) 0x4ff26334
>>> x /d 0x4ff26334
0x4ff26334: 123
  • changing value of var:
>>> set var var = 100
>>> p var
8ドル = 100
>>> x /d 0x4ff26334
0x4ff26334: 100

What doesn't work:

  • software breakpoint (needs flash support)
  • stepping
  • single instruction stepping
Continuation of mistakenly closed #2063 Here is commit with start of support for ESP32-P4. I have started working on flashing support but I need to shelve that plan for the time being. I am pushing the things which seems to work - patch is rough, but more will hopefully come later. Tested with BMA and ESP-prog (FT2232H) on FreeBSD with Waveshare ESP32-P4 board with flashed IDF example. Works: - JTAG scan - attach to target - run program - reset - hardware breakpoint - continue - printing of var in SRAM ``` >>> p var 4ドル = 123 >>> p &var 5ドル = (uint32_t *) 0x4ff26334 >>> x /d 0x4ff26334 0x4ff26334: 123 ``` - changing value of var: ``` >>> set var var = 100 >>> p var 8ドル = 100 >>> x /d 0x4ff26334 0x4ff26334: 100 ``` What doesn't work: - software breakpoint (needs flash support) - stepping - single instruction stepping
dragonmux left a comment
Copy link

This is looking much better 🙂. We've left a review reply on #2063 for one of the notes but have otherwise done a fresh review here. We are satisfied with the items you've addressed and mostly the items here are for subtle bugs we spotted.

We look forward to this being sorted so we can schedule its merge into v2.1 when the merge window opens for that.

This is looking much better 🙂. We've left a review reply on #2063 for one of the notes but have otherwise done a fresh review here. We are satisfied with the items you've addressed and mostly the items here are for subtle bugs we spotted. We look forward to this being sorted so we can schedule its merge into v2.1 when the merge window opens for that.
@ -302,8 +302,31 @@ void riscv_dmi_init(riscv_dmi_s *const dmi)
/* The first DM is always at base address 0 */
uint32_t base_addr = 0U;
do {

This one still needs moving down to line 330 please 🙂

This one still needs moving down to line 330 please 🙂

Please suffix this constant with U - this does a signed-unsigned conversion that can trigger UB otherwise during application of the mask operation (changing the sign bit on a signed number is not permitted for bitwise operations).

Please suffix this constant with `U` - this does a signed-unsigned conversion that can trigger UB otherwise during application of the mask operation (changing the sign bit on a signed number is not permitted for bitwise operations).

We would expect to see this defined just outside the while loop on line 317 - otherwise it won't have the intended effect.

Please suffix the initialiser and the comparison value with U to make them both unsigned.

We would expect to see this defined just outside the `while` loop on line 317 - otherwise it won't have the intended effect. Please suffix the initialiser and the comparison value with `U` to make them both unsigned.
orsolic (Migrated from github.com) reviewed 2025年02月05日 21:45:42 +01:00
@ -302,8 +302,31 @@ void riscv_dmi_init(riscv_dmi_s *const dmi)
/* The first DM is always at base address 0 */
uint32_t base_addr = 0U;
do {
orsolic (Migrated from github.com) commented 2025年02月05日 21:45:42 +01:00
Copy link

I left this out because it wasn't part of the original change for ESP32-P4. Moved to line 330 and added 'U' prefix which, I assume, is needed.

I left this out because it wasn't part of the original change for ESP32-P4. Moved to line 330 and added 'U' prefix which, I assume, is needed.
@ -302,8 +302,31 @@ void riscv_dmi_init(riscv_dmi_s *const dmi)
/* The first DM is always at base address 0 */
uint32_t base_addr = 0U;
do {

Aye, indeed - thank you!

Aye, indeed - thank you!
This pull request has changes conflicting with the target branch.
  • src/target/jtag_devs.c
  • src/target/jtag_scan.c
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin orsolic/esp32p4:orsolic/esp32p4
git switch orsolic/esp32p4
Sign in to join this conversation.
No reviewers
Labels
Clear labels
BMD App
Black Magic Debug App (aka. PC hosted) (not firmware)
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
Bug
Confirmed bug
Build system
Build system
Can't reproduce
Maintainers can't reproduce this problem
CI
Continuous Integration System
Contribution wanted
User contributions welcome
Documentation
Project documentation
Draft
Work in progress draft
Duplicate
This issue or pull request already exists
Enhancement
General project improvement
Feedback wanted
Requires additional submitter feedback
Foreign Host Board
Non Native hardware to runing Black Magic firmware on
GDB
Issue/PR related to GDB
Good first issue
Good for newcommers
HwIssue Mitigation
Solving or mitigating a Hardware issue in Software
Information Needed
Maintainers need more information
NativeHardware
Official Black Magic Debug Hardware
New Host Board
New hardware to run Black Magic firmware on
New Target
New debug target
Off Topic
Something that does not involve the project in any way
Potential Bug
A potential, unconfirmed or very special circumstance bug
Regression
Bug caused by a regression
User Interest Needed
More user interest required before consideration
User Testing Needed
Looking for user testing reports
Won't fix
Outside of the project scope or works as intended
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
blackmagic-debug/blackmagic!2064
Reference in a new issue
blackmagic-debug/blackmagic
No description provided.
Delete branch "orsolic/esp32p4"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?