Giter Site home page Giter Site logo

Comments (22)

EnJens avatar EnJens commented on May 13, 2024 1

@Yatekii correct, I've updated the description to clarify this

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

Thanks for filing this. We'll look into it.

If I understand this right, this is wroking with 0.4.0 but not working with 0.5.0?

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

The actuall error is missing in the log. It is:

Error processing command: A core architecture specific error occured: Failed to write register CSW, address 0x00000000

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

@EnJens could you test if this is still an issue with the 0.6.1/2 releases?

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

I would, but Error processing command: The firmware on the probe is outdated
Not really sure I can update my stlinkv2 clone without bricking it

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

I decided to risk it - probe-rs-cli info works correctly now!

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

I tried a simple dump command which still fails (having added the target-gen generated yaml file):

RUST_LOG=debug cargo run --bin probe-rs-cli --release -- dump 0 16 --chip EFR32MG21A010F1024IM32
    Finished release [optimized] target(s) in 0.06s
     Running `target/release/probe-rs-cli dump 0 16 --chip EFR32MG21A010F1024IM32`
 DEBUG jaylink > libusb 1.0.23.11397
 DEBUG jaylink > libusb has capability API: true
 DEBUG jaylink > libusb has HID access: true
 DEBUG jaylink > libusb has hotplug support: true
 DEBUG jaylink > libusb can detach kernel driver: true
 DEBUG probe_rs::probe::stlink::usb_interface > Acquired libusb context.
 DEBUG probe_rs::probe::stlink::usb_interface > Aquired handle for probe
 DEBUG probe_rs::probe::stlink::usb_interface > Active config descriptor: ConfigDescriptor { bLength: 9, bDescriptorType: 2, wTotalLength: 39, bNumInterfaces: 1, bConfigurationValue: 1, iConfiguration: 0, bmAttributes: 128, bMaxPower: 50, extra: None }
 DEBUG probe_rs::probe::stlink::usb_interface > Device descriptor: DeviceDescriptor { bLength: 18, bDescriptorType: 1, bcdUSB: 512, bDeviceClass: 0, bDeviceSubClass: 0, bDeviceProtocol: 0, bMaxPacketSize: 64, idVendor: 1155, idProduct: 14152, bcdDevice: 256, iManufacturer: 1, iProduct: 2, iSerialNumber: 3, bNumConfigurations: 1 }
 DEBUG probe_rs::probe::stlink::usb_interface > Claimed interface 0 of USB device.
 DEBUG probe_rs::probe::stlink::usb_interface > Succesfully attached to STLink.
 DEBUG probe_rs::probe::stlink                > Initializing STLink...
 DEBUG probe_rs::probe::stlink                > Current device mode: Jtag
 DEBUG probe_rs::probe::stlink                > STLink version: (2, 36)
 DEBUG probe_rs::probe::stlink                > attach(Swd)
 DEBUG probe_rs::probe::stlink                > Current device mode: Jtag
 DEBUG probe_rs::probe::stlink                > Switching protocol to SWD
 DEBUG probe_rs::probe::stlink                > Successfully initialized SWD.
 DEBUG probe_rs::architecture::arm::communication_interface > Debug Port version: DPv2
 DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register DPIDR
 DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register DPIDR, value=0x6ba02477
 DEBUG probe_rs::architecture::arm::communication_interface > DebugPort ID:  DebugPortId {
    revision: 0x6,
    part_no: 0xba,
    version: DPv2,
    min_dp_support: NotImplemented,
    designer: JEP106Code({ cc: 0x04, id: 0x3b } => Some("ARM Ltd")),
}
 DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register ABORT, value=0x0000003c
 DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x00000000
 DEBUG probe_rs::architecture::arm::communication_interface > Requesting debug power
 DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register CTRL/STAT, value=0x50000000
 DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register CTRL/STAT
 DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register CTRL/STAT, value=0xf0000040
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000010
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register CSW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    CSW, value=0x43800050
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x00180000
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000ED30
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x0000001F
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0x00000000
 DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Read first block with len 64 at address 0x000000
 DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW, block with len=16 words
 WARN  probe_rs::probe::stlink                                      > check_status failed: SwdDpFault
 DEBUG probe_rs::probe::stlink                                      > Current device mode: Jtag
Error processing command: A core architecture specific error occured: Failed to read register DRW at address 0x0000000c because: An error specific to a probe type occured: Command failed with status SwdDpFault

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

@EnJens I am not sure you can read flash without unlocking first on every chip. Maybe try reading 0x20000000?

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

I'm not really convinced that's it - it works directly on openocd with zero chip-specific support...
I tried the debug command (with no binary) and I get a similar error on halt in there.
It's a bit spammy but:

RUST_LOG=debug cargo run --bin probe-rs-cli --release -- debug --chip EFR32MG21A010F1024IM32     
    Finished release [optimized] target(s) in 0.05s
     Running `target/release/probe-rs-cli debug --chip EFR32MG21A010F1024IM32`
 DEBUG jaylink > libusb 1.0.23.11397
 DEBUG jaylink > libusb has capability API: true
 DEBUG jaylink > libusb has HID access: true
 DEBUG jaylink > libusb has hotplug support: true
 DEBUG jaylink > libusb can detach kernel driver: true
 DEBUG probe_rs::probe::stlink::usb_interface > Acquired libusb context.
 DEBUG probe_rs::probe::stlink::usb_interface > Aquired handle for probe
 DEBUG probe_rs::probe::stlink::usb_interface > Active config descriptor: ConfigDescriptor { bLength: 9, bDescriptorType: 2, wTotalLength: 39, bNumInterfaces: 1, bConfigurationValue: 1, iConfiguration: 0, bmAttributes: 128, bMaxPower: 50, extra: None }
 DEBUG probe_rs::probe::stlink::usb_interface > Device descriptor: DeviceDescriptor { bLength: 18, bDescriptorType: 1, bcdUSB: 512, bDeviceClass: 0, bDeviceSubClass: 0, bDeviceProtocol: 0, bMaxPacketSize: 64, idVendor: 1155, idProduct: 14152, bcdDevice: 256, iManufacturer: 1, iProduct: 2, iSerialNumber: 3, bNumConfigurations: 1 }
 DEBUG probe_rs::probe::stlink::usb_interface > Claimed interface 0 of USB device.
 DEBUG probe_rs::probe::stlink::usb_interface > Succesfully attached to STLink.
 DEBUG probe_rs::probe::stlink                > Initializing STLink...
 DEBUG probe_rs::probe::stlink                > Current device mode: Jtag
 DEBUG probe_rs::probe::stlink                > STLink version: (2, 36)
 DEBUG probe_rs::probe::stlink                > attach(Swd)
 DEBUG probe_rs::probe::stlink                > Current device mode: Jtag
 DEBUG probe_rs::probe::stlink                > Switching protocol to SWD
 DEBUG probe_rs::probe::stlink                > Successfully initialized SWD.
 DEBUG probe_rs::architecture::arm::communication_interface > Debug Port version: DPv2
 DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register DPIDR
 DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register DPIDR, value=0x6ba02477
 DEBUG probe_rs::architecture::arm::communication_interface > DebugPort ID:  DebugPortId {
    revision: 0x6,
    part_no: 0xba,
    version: DPv2,
    min_dp_support: NotImplemented,
    designer: JEP106Code({ cc: 0x04, id: 0x3b } => Some("ARM Ltd")),
}
 DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register ABORT, value=0x0000003c
 DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register SELECT, value=0x00000000
 DEBUG probe_rs::architecture::arm::communication_interface > Requesting debug power
 DEBUG probe_rs::architecture::arm::communication_interface > Writing DP register CTRL/STAT, value=0x50000000
 DEBUG probe_rs::architecture::arm::communication_interface > Reading DP register CTRL/STAT
 DEBUG probe_rs::architecture::arm::communication_interface > Read    DP register CTRL/STAT, value=0xf0000040
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000010
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register CSW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    CSW, value=0x43800050
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x00130003
 DEBUG probe_rs::architecture::arm::core::m33               > Core was halted when connecting
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000ED30
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x00000001
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000ED30
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x0000001F
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG rustyline                                            > initial cursor location: Some(1)
 DEBUG rustyline                                            > old layout: Layout { prompt_size: Position { col: 0, row: 0 }, default_prompt: false, cursor: Position { col: 0, row: 0 }, end: Position { col: 0, row: 0 } }
 DEBUG rustyline                                            > new layout: Layout { prompt_size: Position { col: 3, row: 0 }, default_prompt: true, cursor: Position { col: 3, row: 0 }, end: Position { col: 3, row: 0 } }
>>  DEBUG rustyline                                            > key: Char('h')
 DEBUG rustyline                                            > Emacs command: SelfInsert(1, 'h')
 DEBUG rustyline                                            > Changeset::insert(0, 'h')
h DEBUG rustyline                                            > key: Char('a')
 DEBUG rustyline                                            > Emacs command: SelfInsert(1, 'a')
 DEBUG rustyline                                            > Changeset::insert(1, 'a')
a DEBUG rustyline                                            > key: Char('l')
 DEBUG rustyline                                            > Emacs command: SelfInsert(1, 'l')
 DEBUG rustyline                                            > Changeset::insert(2, 'l')
l DEBUG rustyline                                            > key: Char('t')
 DEBUG rustyline                                            > Emacs command: SelfInsert(1, 't')
 DEBUG rustyline                                            > Changeset::insert(3, 't')
t DEBUG rustyline                                            > key: Enter
 DEBUG rustyline                                            > Emacs command: AcceptLine

 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0xA05F0003
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x00130003
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF4
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register DRW, value=0x0000000F
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF0
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0x00130003
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xE000EDF8
 DEBUG probe_rs::architecture::arm::communication_interface > Reading register DRW
 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xeffffffe
Core stopped at address 0xeffffffe
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface > Writing register TAR, value=0xEFFFFFFC
 DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Read first block with len 4 at address 0xeffffffc
 DEBUG probe_rs::architecture::arm::communication_interface         > Reading register DRW, block with len=1 words
 WARN  probe_rs::probe::stlink                                      > check_status failed: SwdDpFault
 DEBUG probe_rs::probe::stlink                                      > Current device mode: Jtag
Error processing command: A core architecture specific error occured: Failed to read register DRW at address 0x0000000c because: An error specific to a probe type occured: Command failed with status SwdDpFault

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

also, trying to read e.g. 0x20000000 - which bizarely requires me to input it as decimal - gives me: error: Invalid value for '': number too large to fit in target type. I've verified it's actually an address in ram. I've attached the generated yaml file (Renamed because GitHub)

EFR32MG21 Series.yaml.txt

)

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

the input is in HEX but you need to ommit the 0x afaik, sorry for that.

As expected from SiLabs, the flash algo looks kinda crooked and I am pretty sure we need to change some stuff about our algo because the sector size is not whole number factor of the page size ... you can try flashing tho :)

The error you get looks kinda familiar, I cannot really pinpoint the exact issue yet tho.

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

I gave flashing a shot too, and ultimately same error:

 DEBUG probe_rs::architecture::arm::communication_interface > Read register    DRW, value=0xfffffffe
 DEBUG probe_rs::flashing::flasher                          > Loading algorithm into RAM at address 0x20000200
 DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Write block with total size 496 bytes to address 0x20000200
 DEBUG probe_rs::architecture::arm::communication_interface         > Writing register CSW, value=0x63000012
 DEBUG probe_rs::architecture::arm::communication_interface         > Writing register TAR, value=0x20000200
 DEBUG probe_rs::architecture::arm::memory::adi_v5_memory_interface > Write first block with len 496 at address 0x20000200
 DEBUG probe_rs::architecture::arm::communication_interface         > Writing register DRW, block with len=124 words
 WARN  probe_rs::probe::stlink                                      > check_status failed: SwdApFault
 DEBUG probe_rs::probe::stlink                                      > Current device mode: Jtag
Error processing command: Something during memory interaction went wrong: A core architecture specific error occured: Failed to write register DRW at address 0x0000000c because: An error specific to a probe type occured: Command failed with status SwdApFault

I guess it doesn't even get to trying out the actual algorithm?

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

Yeah, the failure happens before flashing takes place. Kinda hard to tell from here what's wrong. But the DRW register is the Data read write register, in short, where you write the actual data of the transfer once you set the address in TAR and have the rest configured via CSW. So it's really odd this fails. There is a few reasons this could happen, but idk atm what's so special about this core :/

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

Is there any way I can provide any useful info from some kind of openocd debug logs?
As previously mentioned, it works out of the box (except flashing of course) on there.

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

Hmm idk how to actually log low level transfer calls in OpenOCD, but if you can get a log of what they do in terms of ARM register writes, that could help :)

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

This seems to be it :)
debug.log
(Note that this is a slightly modified local openocd with flash driver implemented for EFR32MG21)

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

Newer experiences show that maybe, for this chip, an attach under reset is required too!

Do you have any news on this @EnJens?

Maybe someone is in the mood to work on this on the impl days :)

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

@EnJens could you try this with master of probe-rs?
Also with the same logs enabled. I think this is a general issue for some chips and I would like to verify this :)

from probe-rs.

EnJens avatar EnJens commented on May 13, 2024

I hope to get back to it in a week or two and give it a try! Sorry for the delay

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

All good, take your time :)

from probe-rs.

mattico avatar mattico commented on May 13, 2024

I had this issue with a DAPLink Probe connected to a STM32H743ZIT6 over SWD at 24000kHz. Reducing the speed to 20000kHz stops the issue from happening - or at least its so infrequent that I haven't seen it yet. Might just be a signal integrity issue?

from probe-rs.

Yatekii avatar Yatekii commented on May 13, 2024

Since this did not get any more attention it seems to be resolved. Feel free to reopen if this is still an issue :)

from probe-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.