Skip to content

Unable to flash py32f002b #65

@sanjay900

Description

@sanjay900

I accidentally erased the entire flash on my microcontroller, wiping out the bootloader. While i can use SWD, i can't actually seem to flash anything as things keep hardfaulting.

When i use pyocd, i get the following error:

0000554 E IPSR should be 0 but is 0x3 [flash]
0000554 E Stack pointer should be 0x20000940 but is 0x20000910 [flash]
0000554 E PC should be 0x20000a4c but is 0xfffffffe [flash]

When i use J-Link, i get this:

'loadfile': Performing implicit reset & halt of MCU.
Reset type: NORMAL (https://wiki.segger.com/J-Link_Reset_Strategies)
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading file [full.bin]...

****** Error: PC of target system has unexpected value after erasing sectors. (PC = 0xFFFFFFFE)!
---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
        PC   = FFFFFFFE
Current:        R0   = 08000000,        R1   = 40022000,        R2   = 000000FF,        R3   = 00000001
        R4   = 00000800,        R5   = 01000000,        R6   = 200003A0,        R7   = 000FF420
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Failed to erase sectors.

Unspecified error -1
J-Link>

Any ideas on how one could flash a board that has no firmware or bootloader like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions