LPC55S69 bricked after trying to enable SWO debug console

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC55S69 bricked after trying to enable SWO debug console

1,632 Views
scottm
Senior Contributor II

I was trying to reconfigure a project to use SWO for the debug console on account of needing to reassign the FlexComm previously used for the debug UART (the manual could really use a more prominent warning about FlexComm3 not supporting I2S signal sharing) and after flashing my new firmware I lost all ability to debug and program the MCU.

I tried my P&E Cyclone ACP with MCUX and in standalone mode, and I tried an MCU-Link and an LPC-Link2. None of them could establish a connection. I tested it out on my LPCxpresso55S69 board with its built-in LPC-Link and it did the same thing - bricked it with no ability to erase and try again.

The solution for now is to pull the clock crystal, which halts execution before the code can get as far as the debug console init.

How is this possible? Why are the debug interfaces not able to force the CPU into debug mode without letting them run first? Is there some workaround?

I saved the 'poison' firmware image and I'm happy to share if you'd like to recreate the issue.

Thanks,

Scott

0 Kudos
Reply
15 Replies

1,594 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

According to your description, 

When you enabled SWO output  and reconfigured the debug console, you most likely modified the clock source or pin muxing in a way that unintentionally affected the SWD/SWO pins  or the  debug clock domain.

When you reset and power up:

If your firmware reconfigures clocks, pins, or secure settings very early (e.g. before SystemInit() finishes),

the debugger never gets a chance to run before the MCU becomes unreachable.

So i think you can disable swo in early boot.

BR

Harry

0 Kudos
Reply

1,582 Views
scottm
Senior Contributor II

Hi Harry,

It's not enabling it early in the boot process. It happens in main(), after BOARD_InitBootPins() and BOARD_InitBootClocks(). That's the only way I was able to recover it - because it was after the switch to the external crystal, I could desolder the crystal and make sure it hung there forever.

Shouldn't the debugger be able to at least perform a mass erase regardless of what the target is doing? How do I recover an MCU like this if I'm not able to stop it by pulling the crystal?

Thanks,

Scott

0 Kudos
Reply

1,526 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

The SWD debugging interface of LPC55S69 depends on the clock.
Your code may have changed the debugging clock or PIN MUX when switching to an external crystal oscillator and enabling SWO in the later stage of main(),
Causing the debugging port to lose clock, making it impossible for the debugger to reconnect or erase.

So i think you can try to 

Use your debug probe’s Connect under Reset on connection option. 

In MCUXpresso IDE,

Harry_Zhang_0-1761623987372.png

BR

Harry

0 Kudos
Reply

1,504 Views
scottm
Senior Contributor II

Hi Harry,

That didn't seem to change anything. I tried with one of the boards I haven't pulled the crystal from yet, that I bricked with the bad firmware load, and it's still unable to connect. I've tried similar settings for the P&E interface.

The only change from the firmware versions that have worked for years is this:

SystemCoreClockUpdate();
DbgConsole_Init(DEBUG_CONSOLE_SWO_PORT, DEBUG_CONSOLE_SWO_BAUDRATE, kSerialPort_Swo, SystemCoreClock);

Just to make sure we're on the same page, can you confirm that there should still be a way to erase and reload a device as long as flash protection isn't enabled?

Thanks,

Scott

0 Kudos
Reply

1,478 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

I think you  can put the chip into ISP mode and then use ISP commands to erase the first 1KB or 10KB of the flash to corrupt the firmware header, preventing the chip from jumping to the firmware, and then connect using a debugger.

Harry_Zhang_0-1761794696831.png

The isp pin is PIO0_5.

Harry_Zhang_1-1761794736006.png

And then use blhost command.

Harry_Zhang_3-1761794780035.png

 

Harry_Zhang_2-1761794767276.png

By the way, what is your application?

BR

Harry

0 Kudos
Reply

1,440 Views
scottm
Senior Contributor II

Hi Harry,

That might work for the LPCxpresso55S69 board, but it doesn't help with any of my own boards. With MON08 and BDM debuggers on older MCUs there was always a way to mass erase the flash no matter what was loaded - it'd go into debug mode right out of reset. Is SWD just not capable of that?

In the course of troubleshooting this I've run into some other issues I'm following up on. When I wrote this bootloader back in 2023, I noticed that the LPC55S69 documentation was ambiguous about the top of usable flash memory - in one place it says 16 pages / 10 kB are reserved and in another it says 17 pages / 10 kB. 16 pages would be 8 kB and 17 pages is 8.5 kB, so obviously something's wrong there.

As far as anyone can tell, the correct top of memory is 0x9d800. When I checked the debugger memory configuration files, the top was given as 0x98000, which is definitely wrong. I reported this in a thread back in 2023.

Apparently those memory configurations were fixed at some point (though there's still no updated errata for the LPC55S69) but I discovered that my project file kept the old (incorrect) settings. While trying to sort it out, I ended up uninstalling all versions of MCUXpresso and Linkserver and deleted all of my launch configurations and then after reinstalling discovered that the project also seemed to be referencing an out-of-date Linkserver. P&E's drivers are harder to sort out because the Cyclone ACP isn't even listed on their site.

Recreating the entire project with the latest IDE would take hours of work to manually document and recreate all of the settings and then do regression testing. Do you know of any other places that out of date debugger references could be hiding? Something's definitely still wrong. At one point the only way I could get it to program was by using the P&E standalone PROGACMP utility - which proved that the MCU was responding just fine with the same debugger and the same connections, but through gdb it simply wasn't working. At the moment the only interface I can get to work reliably with the project is an old LPC-Link2 I found in a drawer.

To answer your question, this particular project is a multi-channel RoIP interface.

Thanks,

Scott

0 Kudos
Reply

1,369 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

That might work for the LPCxpresso55S69 board, but it doesn't help with any of my own boards. With MON08 and BDM debuggers on older MCUs there was always a way to mass erase the flash no matter what was loaded - it'd go into debug mode right out of reset. Is SWD just not capable of that?

This occurs because during the process of connecting the debugger to the chip, the chip is reset and then executes code from its flash memory. Since the customer's code modifies the SWD-related I/O functions during this process, it ultimately causes the debugger connection to fail. This is why erasing part of the flash at starting position resolves the issue.

Regarding the size of the flash, it should be 631.5 KB, the last 17 pages(8.5 KB) are reserved, I am currently confirming this internally.

BR

Harry

0 Kudos
Reply

1,252 Views
scottm
Senior Contributor II

There's definitely something more going on than pins getting reassigned. Debugging in MCUXpresso has always been very unreliable for me and I'd love to get to the bottom of it. It was working fine for the first half of the day. I made a minor change (enabling the FreeRTOS vApplicationMallocFailed() hook and defining a function with __BKPT(0)) and haven't been able to load and debug anything since, with either the Cyclone or LPC-Link2.

The connection is fine. And in fact I'm able to connect with PROGACMP and erase the device, and verify that it's erased. It's coming back all 00 when on most devices I expect FF, so I don't know if that's right, but it's at least passing the blank check.

Even with an erased device, I can't do anything with it. Here's what I get with the GUI flash tool. There are a few things going on here - first, the dialog indicates it completed when the log shows that it failed. And from the log you can see that it's got the wrong range, or at least not the complete range.

I can also use the Cyclone to program a known-good image and the device runs, but I still can't do anything from MCUX.

I'm going to reboot now and see if that makes any difference.

scottm_0-1762646822793.png

 

0 Kudos
Reply

1,243 Views
scottm
Senior Contributor II

OK, I'm making some progress. I eliminated several things - tried a new board, another debug interface, a brand new cable, and tried using the LPCxpresso board as well. None of them would get past the "Range could not be erased" error.

Now, when I said the erase range wasn't correct, or wasn't complete, that's because this project has a bootloader image included at 0x9b000 with some reserved space at 0x9a000 for bootloader commands. It wasn't showing the high range.

So to check if it had something to do with that high range, I loaded the hello_world sample project and it erased and programmed just fine. It's not a hardware problem at all.

Next, I switched over to the bootloader's own standalone project. This project has been untouched for a year or two. It links as a standalone application so that it can optionally be loaded on a blank device and will pick up its firmware update from external SPI flash, so it has a vector table of its own.

I tried debugging it with the P&E debug configuration that hasn't been touched in ages. It failed with the same error:

Erasing ranges ...

Range 00000000-00001FFF




Range could not be erased.

 

Note that the 0000-1FFFF range only reflects the vector table and not the code. To test if this was a problem with non-contiguous memory areas, I created a new memory section called UNUSED_FLASH that occupies the rest of flash and used FILL(0x55) to give it some data. When it's linked, it shows it 100% full:

Memory region Used Size Region Size %age Used

VECTOR_FLASH: 304 B 1 KB 29.69%

COMMAND_FLASH: 60 B 512 B 11.72%

SVECT: 4 B 4 B 100.00%

UNUSED_FLASH: 633344 B 633344 B 100.00%

PROGRAM_FLASH: 9880 B 10236 B 96.52%

SRAM: 9528 B 16 KB 58.15%

USB_RAM: 0 B 16 KB 0.00%

Finished building target: LPC55S69_Bootloader.axf

 

I launched it again, with the same problem. It shows that it's erasing only the 0000-1FFF range, and it fails. So whatever's going on seems to be related to how it determines which ranges to erase and how it verifies the upload.

This seems to be a recent thing (I'm running MCUX v25.6 build 136) and my hunch is that it feels like all of the other unreliable, quirky debug behavior I've encountered with MCUX because the IDE just has bad integration with gdb. Here's how the session ends:

PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session.




PE-ERROR: Error downloading to the device. Terminating debug session.

Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "52065" from 6225

Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "52070" from 7225

INFO: DAP IDCODE = 0x6BA02477

Target Disconnected.

 

Except it doesn't actually end - I can hear the CPU fan kick on and arm-none-eabi-gdb.exe consumes 100% CPU time on one core. Here's gdb's output:

611,647 (gdb)

611,648 &"load B:\\\\home\\\\eb6\\\\bootloader\\\\Debug\\\\LPC55S69_Bootloader.axf\n"

611,648 ~"Loading section .text, size 0x130 lma 0x0\n"

611,648 26+download,{section=".text",section-size="304",total-size="1801748"}

611,648 26+download,{section=".text",section-sent="304",section-size="304",total-sent="304",total-si\

ze="1801748"}

611,648 ~"Loading section .commands, size 0x3c lma 0x9ae00\n"

611,648 26+download,{section=".commands",section-size="60",total-size="1801748"}

611,648 ~"Loading section .startvector, size 0x4 lma 0x9b000\n"

611,648 26+download,{section=".startvector",section-size="4",total-size="1801748"}

611,648 ~"Loading section .text, size 0x2690 lma 0x9b004\n"

611,648 26+download,{section=".text",section-size="9872",total-size="1801748"}

611,650 ~"Loading section .data, size 0x8 lma 0x9d694\n"

611,650 26+download,{section=".data",section-size="8",total-size="1801748"}

611,663 27interpreter-exec mi2 "-break-insert -t -f main"

611,788 28-list-thread-groups

615,695 &"Error finishing flash operation\n"

615,695 26^error,msg="Error finishing flash operation"

615,695 (gdb)

615,695 &"monitor selectcore 0\n"

615,695 @"Command Executed successfully: selectcore 0\r\n"

615,695 ^done

615,695 (gdb)

615,695 &"interpreter-exec mi2 \"-break-insert -t -f main\"\n"

615,702 &"warning: could not convert 'main' from the host encoding (CP1252) to UTF-32.\nThis normall\

y should not happen, please file a bug report."

615,702 &"\n"

615,705 ~"Note: automatically using hardware breakpoints for read-only addresses.\n"

615,705 ^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0009b138",func="main\

",file="../source/LPC55S69_Bootloader.c",fullname="B:\\home\\eb6\\bootloader\\source\\LPC55S6\

9_Bootloader.c",line="150",thread-groups=["i1"],times="0",original-location="main"}

615,705 27^done

615,705 (gdb)

615,705 29flushreg

continue

monitor refreshviews

continue

615,705 28^done,groups=[{id="i1",type="process",pid="42000",executable="B:\\home\\eb6\\bootlo\

ader\\Debug\\LPC55S69_Bootloader.axf"}]

615,705 (gdb)

615,705 &"flushreg\n"

615,705 ~"Register cache flushed.\n"

615,707 30-list-thread-groups i1

615,721 29^done

615,721 (gdb)

615,721 &"continue\n"

615,721 ~"Continuing.\n"

615,721 ^running

615,721 *running,thread-id="all"

615,721 (gdb)

615,766 &"warning: Exception condition detected on fd 528\n"


 

And if you'll recall from my last message, the GUI flash tool similarly doesn't properly register fault conditions.

For now I'm up and running by excluding my bootloader from the .ld file.

Let me know what you think about the non-contiguous memory erase/verify problem. And I would be happy to help your developers with testing fixes to the gdb integration because that's been a constant headache for years.

Regards,

Scott

0 Kudos
Reply

1,242 Views
scottm
Senior Contributor II

One more update before I give this a rest for the evening. I'm able to reproduce the problem, at least for P&E, by modifying the led_blinky demo. This not only fails the "Erasing ranges" operation, it also frequently crashes gdb.

scottm_0-1762655423735.png

To reproduce, load up the led_blinky demo for the LPCxpresso55S69 board. Disable the managed linker script. Add some dummy data:

__attribute__((used, section(".dummy")))
const char dummy_data[] = {1,2,3,4,5,6,7,8,10};

Edit the .ld files to add a high section:

MEMORY
{
/* Define each memory region */
PROGRAM_FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x90000 /* 630K bytes (alias Flash) */
UPPER_FLASH (rx) : ORIGIN = 0x9d600, LENGTH = 0x20
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000 /* 256K bytes (alias RAM) */
SRAMX (rwx) : ORIGIN = 0x4000000, LENGTH = 0x8000 /* 32K bytes (alias RAM2) */
USB_RAM (rwx) : ORIGIN = 0x40100000, LENGTH = 0x4000 /* 16K bytes (alias RAM3) */
SRAM4 (rwx) : ORIGIN = 0x20040000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
}
 .dummy : ALIGN(4)
{
KEEP(*(.dummy))
. = ALIGN(4);
} > UPPER_FLASH

Build and upload. Twiddle dummy_data and one of the timer constants to make sure the code changes. Recompile and upload again and it fails.

Scott

0 Kudos
Reply

1,046 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

Sorry, Can you share  your project so that i can reproduce this issue?

BR

Harry

0 Kudos
Reply

1,036 Views
scottm
Senior Contributor II

Here you go.

0 Kudos
Reply

963 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

Thanks for your project.

Harry_Zhang_0-1763027541151.png

 

I have conducted multiple tests on my lpc55s69 EVK board.

I can debug it successfully every time.

Harry_Zhang_1-1763027634720.png

I can mass erase  successfully every time.

Harry_Zhang_2-1763027704573.png

 

I am sorry i can not reproduce the issue you reported.

How can i reproduce this issue?

BR

Harry

 

0 Kudos
Reply

808 Views
scottm
Senior Contributor II

Hi Harry,

There are at least two different issues here. The blinky demo I shared illustrates the problem with the P&E driver. I've talked to P&E and they believe it's a problem with the erase function in their driver, which they're working on. The workaround for now is to set it to erase the whole chip rather than having it erased only the used areas.

The other problem doesn't appear with a new project. I've found that the underlying problem is that the memory definition MCUX had for the LPC55S69 was wrong:

scottm_0-1763321228390.png

It should be 0x9d800, not 0x98000. This is from a project created two years ago. The problem has been fixed in MCUX at some point since then, but the project was created with the incorrect setting and carried that over. If there was any mention of this in the MCUX release notes, I didn't see it.

Now, what I see as an additional problem is the lack of any meaningful error message. This should generate some kind of warning that it's trying to program outside of the defined memory range. Instead we just get a generic failure:

scottm_1-1763321429385.png

 

The original cause of all of this mess seems to have been bad documentation:

scottm_2-1763321697281.png

The LPC55S69 uses 512-byte pages so 16 pages is 8 kB and the above cannot be correct. What's worse is that someone has looked at this and corrected the figure from 17 pages to 16 but didn't correct the size:

scottm_3-1763321918646.png

If the memory map had simply stated the upper bound of the non-reserved flash area all of this could have been avoided. As it is, the datasheet still does not make the upper bound clear. If we subtract 16 pages from 0x9ffff we get 0x9dfff for the top of flash. If we subtract 10k we get 0x9d7ff for the top. The PFR documentation shows that the PFR starts at 0x9de00:

scottm_4-1763322279589.png

Nothing in the datasheet would seem to account for the space between 0x9d800 and 0x9de00.

The usable program memory range is one of the most basic parameters needed to program any MCU and the datasheet manages to obfuscate it so thoroughly that both NXP and P&E got the implementation wrong.

To recap: P&E is fixing their driver. The workaround is to erase the whole device. Projects created with the wrong memory definition must be manually updated to reflect the correct range before the RedLink driver will work. As of rev 2.8, the UM11126 manual still contains incorrect information about the flash size. And there's a lot of room for improvement in how the IDE presents failures during the programming process.

Scott

0 Kudos
Reply

610 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @scottm 

Thank you for identifying this issue and sharing your observations. We will review the documentation and IDE behavior to ensure better clarity and user experience going forward.

BR

Harry

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2192002%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2192002%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20was%20trying%20to%20reconfigure%20a%20project%20to%20use%20SWO%20for%20the%20debug%20console%20on%20account%20of%20needing%20to%20reassign%20the%20FlexComm%20previously%20used%20for%20the%20debug%20UART%20(the%20manual%20could%26nbsp%3B%3CEM%3Ereally%3C%2FEM%3E%20use%20a%20more%20prominent%20warning%20about%20FlexComm3%20not%20supporting%20I2S%20signal%20sharing)%20and%20after%20flashing%20my%20new%20firmware%20I%20lost%20all%20ability%20to%20debug%20and%20program%20the%20MCU.%3C%2FP%3E%3CP%3EI%20tried%20my%20P%26amp%3BE%20Cyclone%20ACP%20with%20MCUX%20and%20in%20standalone%20mode%2C%20and%20I%20tried%20an%20MCU-Link%20and%20an%20LPC-Link2.%20None%20of%20them%20could%20establish%20a%20connection.%20I%20tested%20it%20out%20on%20my%20LPCxpresso55S69%20board%20with%20its%20built-in%20LPC-Link%20and%20it%20did%20the%20same%20thing%20-%20bricked%20it%20with%20no%20ability%20to%20erase%20and%20try%20again.%3C%2FP%3E%3CP%3EThe%20solution%20for%20now%20is%20to%20pull%20the%20clock%20crystal%2C%20which%20halts%20execution%20before%20the%20code%20can%20get%20as%20far%20as%20the%20debug%20console%20init.%3C%2FP%3E%3CP%3EHow%20is%20this%20possible%3F%20Why%20are%20the%20debug%20interfaces%20not%20able%20to%20force%20the%20CPU%20into%20debug%20mode%20without%20letting%20them%20run%20first%3F%20Is%20there%20some%20workaround%3F%3C%2FP%3E%3CP%3EI%20saved%20the%20'poison'%20firmware%20image%20and%20I'm%20happy%20to%20share%20if%20you'd%20like%20to%20recreate%20the%20issue.%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EScott%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206744%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206744%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20identifying%20this%20issue%20and%20sharing%20your%20observations.%20We%20will%20review%20the%20documentation%20and%20IDE%20behavior%20to%20ensure%20better%20clarity%20and%20user%20experience%20going%20forward.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Harry%2C%3C%2FP%3E%3CP%3EThere%20are%20at%20least%20two%20different%20issues%20here.%20The%20blinky%20demo%20I%20shared%20illustrates%20the%20problem%20with%20the%20P%26amp%3BE%20driver.%20I've%20talked%20to%20P%26amp%3BE%20and%20they%20believe%20it's%20a%20problem%20with%20the%20erase%20function%20in%20their%20driver%2C%20which%20they're%20working%20on.%20The%20workaround%20for%20now%20is%20to%20set%20it%20to%20erase%20the%20whole%20chip%20rather%20than%20having%20it%20erased%20only%20the%20used%20areas.%3C%2FP%3E%3CP%3EThe%20other%20problem%20doesn't%20appear%20with%20a%26nbsp%3B%3CEM%3Enew%3C%2FEM%3E%20project.%20I've%20found%20that%20the%20underlying%20problem%20is%20that%20the%20memory%20definition%20MCUX%20had%20for%20the%20LPC55S69%20was%20wrong%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_0-1763321228390.png%22%20style%3D%22width%3A%20591px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_0-1763321228390.png%22%20style%3D%22width%3A%20591px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365780iD7352CBC506FDB8F%2Fimage-dimensions%2F591x185%3Fv%3Dv2%22%20width%3D%22591%22%20height%3D%22185%22%20role%3D%22button%22%20title%3D%22scottm_0-1763321228390.png%22%20alt%3D%22scottm_0-1763321228390.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIt%20should%20be%200x9d800%2C%20not%200x98000.%20This%20is%20from%20a%20project%20created%20two%20years%20ago.%20The%20problem%20has%20been%20fixed%20in%20MCUX%20at%20some%20point%20since%20then%2C%20but%20the%20project%20was%20created%20with%20the%20incorrect%20setting%20and%20carried%20that%20over.%20If%20there%20was%20any%20mention%20of%20this%20in%20the%20MCUX%20release%20notes%2C%20I%20didn't%20see%20it.%3C%2FP%3E%3CP%3ENow%2C%20what%20I%20see%20as%20an%20additional%20problem%20is%20the%20lack%20of%20any%20meaningful%20error%20message.%20This%26nbsp%3B%3CEM%3Eshould%3C%2FEM%3E%20generate%20some%20kind%20of%20warning%20that%20it's%20trying%20to%20program%20outside%20of%20the%20defined%20memory%20range.%20Instead%20we%20just%20get%20a%20generic%20failure%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_1-1763321429385.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_1-1763321429385.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365781iADD26DF2C80CC515%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22scottm_1-1763321429385.png%22%20alt%3D%22scottm_1-1763321429385.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20original%20cause%20of%20all%20of%20this%20mess%20seems%20to%20have%20been%20bad%20documentation%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_2-1763321697281.png%22%20style%3D%22width%3A%20589px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_2-1763321697281.png%22%20style%3D%22width%3A%20589px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365782iC9C8D4D299C95029%2Fimage-dimensions%2F589x92%3Fv%3Dv2%22%20width%3D%22589%22%20height%3D%2292%22%20role%3D%22button%22%20title%3D%22scottm_2-1763321697281.png%22%20alt%3D%22scottm_2-1763321697281.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20LPC55S69%20uses%20512-byte%20pages%20so%2016%20pages%20is%208%20kB%20and%20the%20above%20cannot%20be%20correct.%20What's%20worse%20is%20that%20someone%20has%20looked%20at%20this%20and%20corrected%20the%20figure%20from%2017%20pages%20to%2016%20but%20didn't%20correct%20the%20size%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_3-1763321918646.png%22%20style%3D%22width%3A%20557px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_3-1763321918646.png%22%20style%3D%22width%3A%20557px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365783i94D37F50039CC478%2Fimage-dimensions%2F557x39%3Fv%3Dv2%22%20width%3D%22557%22%20height%3D%2239%22%20role%3D%22button%22%20title%3D%22scottm_3-1763321918646.png%22%20alt%3D%22scottm_3-1763321918646.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIf%20the%20memory%20map%20had%20simply%20stated%20the%20upper%20bound%20of%20the%20non-reserved%20flash%20area%20all%20of%20this%20could%20have%20been%20avoided.%20As%20it%20is%2C%20the%20datasheet%20still%20does%20not%20make%20the%20upper%20bound%20clear.%20If%20we%20subtract%2016%20pages%20from%200x9ffff%20we%20get%200x9dfff%20for%20the%20top%20of%20flash.%20If%20we%20subtract%2010k%20we%20get%200x9d7ff%20for%20the%20top.%20The%20PFR%20documentation%20shows%20that%20the%20PFR%20starts%20at%200x9de00%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_4-1763322279589.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_4-1763322279589.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365784i9C2B254CA71A3BAD%2Fimage-dimensions%2F544x131%3Fv%3Dv2%22%20width%3D%22544%22%20height%3D%22131%22%20role%3D%22button%22%20title%3D%22scottm_4-1763322279589.png%22%20alt%3D%22scottm_4-1763322279589.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ENothing%20in%20the%20datasheet%20would%20seem%20to%20account%20for%20the%20space%20between%200x9d800%20and%200x9de00.%3C%2FP%3E%3CP%3EThe%20usable%20program%20memory%20range%20is%20one%20of%20the%20most%20basic%20parameters%20needed%20to%20program%26nbsp%3B%3CEM%3Eany%3C%2FEM%3E%20MCU%20and%20the%20datasheet%20manages%20to%20obfuscate%20it%20so%20thoroughly%20that%20both%20NXP%20and%20P%26amp%3BE%20got%20the%20implementation%20wrong.%3C%2FP%3E%3CP%3ETo%20recap%3A%20P%26amp%3BE%20is%20fixing%20their%20driver.%20The%20workaround%20is%20to%20erase%20the%20whole%20device.%20Projects%20created%20with%20the%20wrong%20memory%20definition%20must%20be%20manually%20updated%20to%20reflect%20the%20correct%20range%20before%20the%20RedLink%20driver%20will%20work.%20As%20of%20rev%202.8%2C%20the%20UM11126%20manual%20still%20contains%20incorrect%20information%20about%20the%20flash%20size.%20And%20there's%20a%20lot%20of%20room%20for%20improvement%20in%20how%20the%20IDE%20presents%20failures%20during%20the%20programming%20process.%3C%2FP%3E%3CP%3EScott%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204391%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204391%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20project.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_0-1763027541151.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_0-1763027541151.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365491i8D50DD249C484B2B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_0-1763027541151.png%22%20alt%3D%22Harry_Zhang_0-1763027541151.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EI%20have%20conducted%20multiple%20tests%20on%20my%20lpc55s69%20EVK%20board.%3C%2FP%3E%0A%3CP%3EI%20can%20debug%20it%20successfully%20every%20time.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_1-1763027634720.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_1-1763027634720.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365492i260F66CA746569C0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_1-1763027634720.png%22%20alt%3D%22Harry_Zhang_1-1763027634720.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20can%20mass%20erase%26nbsp%3B%20successfully%20every%20time.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_2-1763027704573.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_2-1763027704573.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365493iB97B4EC8EFDDB5E6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_2-1763027704573.png%22%20alt%3D%22Harry_Zhang_2-1763027704573.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EI%20am%20sorry%20i%20can%20not%20reproduce%20the%20issue%20you%20reported.%3C%2FP%3E%0A%3CP%3EHow%20can%20i%20reproduce%20this%20issue%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHere%20you%20go.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202693%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202693%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESorry%2C%20Can%20you%20share%26nbsp%3B%20your%20project%20so%20that%20i%20can%20reproduce%20this%20issue%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201226%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201226%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOne%20more%20update%20before%20I%20give%20this%20a%20rest%20for%20the%20evening.%20I'm%20able%20to%20reproduce%20the%20problem%2C%20at%20least%20for%20P%26amp%3BE%2C%20by%20modifying%20the%20led_blinky%20demo.%20This%20not%20only%20fails%20the%20%22Erasing%20ranges%22%20operation%2C%20it%20also%20frequently%20crashes%20gdb.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_0-1762655423735.png%22%20style%3D%22width%3A%20704px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_0-1762655423735.png%22%20style%3D%22width%3A%20704px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364519i78AD28B881C2845D%2Fimage-dimensions%2F704x350%3Fv%3Dv2%22%20width%3D%22704%22%20height%3D%22350%22%20role%3D%22button%22%20title%3D%22scottm_0-1762655423735.png%22%20alt%3D%22scottm_0-1762655423735.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ETo%20reproduce%2C%20load%20up%20the%20led_blinky%20demo%20for%20the%20LPCxpresso55S69%20board.%20Disable%20the%20managed%20linker%20script.%20Add%20some%20dummy%20data%3A%3C%2FP%3E%3CPRE%3E__attribute__((used%2C%20section(%22.dummy%22)))%3CBR%20%2F%3Econst%20char%20dummy_data%5B%5D%20%3D%20%7B1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C10%7D%3B%3C%2FPRE%3E%3CP%3EEdit%20the%20.ld%20files%20to%20add%20a%20high%20section%3A%3C%2FP%3E%3CPRE%3EMEMORY%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F*%20Define%20each%20memory%20region%20*%2F%3CBR%20%2F%3EPROGRAM_FLASH%20(rx)%20%3A%20ORIGIN%20%3D%200x0%2C%20LENGTH%20%3D%200x90000%20%2F*%20630K%20bytes%20(alias%20Flash)%20*%2F%3CBR%20%2F%3EUPPER_FLASH%20(rx)%20%3A%20ORIGIN%20%3D%200x9d600%2C%20LENGTH%20%3D%200x20%20%3CBR%20%2F%3ESRAM%20(rwx)%20%3A%20ORIGIN%20%3D%200x20000000%2C%20LENGTH%20%3D%200x40000%20%2F*%20256K%20bytes%20(alias%20RAM)%20*%2F%20%3CBR%20%2F%3ESRAMX%20(rwx)%20%3A%20ORIGIN%20%3D%200x4000000%2C%20LENGTH%20%3D%200x8000%20%2F*%2032K%20bytes%20(alias%20RAM2)%20*%2F%20%3CBR%20%2F%3EUSB_RAM%20(rwx)%20%3A%20ORIGIN%20%3D%200x40100000%2C%20LENGTH%20%3D%200x4000%20%2F*%2016K%20bytes%20(alias%20RAM3)%20*%2F%20%3CBR%20%2F%3ESRAM4%20(rwx)%20%3A%20ORIGIN%20%3D%200x20040000%2C%20LENGTH%20%3D%200x4000%20%2F*%2016K%20bytes%20(alias%20RAM4)%20*%2F%20%3CBR%20%2F%3E%7D%3C%2FPRE%3E%3CPRE%3E%20.dummy%20%3A%20ALIGN(4)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EKEEP(*(.dummy))%3CBR%20%2F%3E.%20%3D%20ALIGN(4)%3B%3CBR%20%2F%3E%7D%20%26gt%3B%20UPPER_FLASH%3C%2FPRE%3E%3CP%3EBuild%20and%20upload.%20Twiddle%20dummy_data%20and%20one%20of%20the%20timer%20constants%20to%20make%20sure%20the%20code%20changes.%20Recompile%20and%20upload%20again%20and%20it%20fails.%3C%2FP%3E%3CP%3EScott%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201220%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201220%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOK%2C%20I'm%20making%20some%20progress.%20I%20eliminated%20several%20things%20-%20tried%20a%20new%20board%2C%20another%20debug%20interface%2C%20a%20brand%20new%20cable%2C%20and%20tried%20using%20the%20LPCxpresso%20board%20as%20well.%20None%20of%20them%20would%20get%20past%20the%20%22Range%20could%20not%20be%20erased%22%20error.%3C%2FP%3E%3CP%3ENow%2C%20when%20I%20said%20the%20erase%20range%20wasn't%20correct%2C%20or%20wasn't%20complete%2C%20that's%20because%20this%20project%20has%20a%20bootloader%20image%20included%20at%200x9b000%20with%20some%20reserved%20space%20at%200x9a000%20for%20bootloader%20commands.%20It%20wasn't%20showing%20the%20high%20range.%3C%2FP%3E%3CP%3ESo%20to%20check%20if%20it%20had%20something%20to%20do%20with%20that%20high%20range%2C%20I%20loaded%20the%20hello_world%20sample%20project%20and%20it%20erased%20and%20programmed%20just%20fine.%20It's%20not%20a%20hardware%20problem%20at%20all.%3C%2FP%3E%3CP%3ENext%2C%20I%20switched%20over%20to%20the%20bootloader's%20own%20standalone%20project.%20This%20project%20has%20been%20untouched%20for%20a%20year%20or%20two.%20It%20links%20as%20a%20standalone%20application%20so%20that%20it%20can%20optionally%20be%20loaded%20on%20a%20blank%20device%20and%20will%20pick%20up%20its%20firmware%20update%20from%20external%20SPI%20flash%2C%20so%20it%20has%20a%20vector%20table%20of%20its%20own.%3C%2FP%3E%3CP%3EI%20tried%20debugging%20it%20with%20the%20P%26amp%3BE%20debug%20configuration%20that%20hasn't%20been%20touched%20in%20ages.%20It%20failed%20with%20the%20same%20error%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3EErasing%20ranges%20...%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3ERange%2000000000-00001FFF%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3ERange%20could%20not%20be%20erased.%20%3C%2FSPAN%3E%3C%2FPRE%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CP%3ENote%20that%20the%200000-1FFFF%20range%20only%20reflects%20the%20vector%20table%20and%20not%20the%20code.%20To%20test%20if%20this%20was%20a%20problem%20with%20non-contiguous%20memory%20areas%2C%20I%20created%20a%20new%20memory%20section%20called%20UNUSED_FLASH%20that%20occupies%20the%20rest%20of%20flash%20and%20used%20FILL(0x55)%20to%20give%20it%20some%20data.%20When%20it's%20linked%2C%20it%20shows%20it%20100%25%20full%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3EMemory%20region%20Used%20Size%20Region%20Size%20%25age%20Used%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EVECTOR_FLASH%3A%20304%20B%201%20KB%2029.69%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3ECOMMAND_FLASH%3A%2060%20B%20512%20B%2011.72%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3ESVECT%3A%204%20B%204%20B%20100.00%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EUNUSED_FLASH%3A%20633344%20B%20633344%20B%20100.00%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EPROGRAM_FLASH%3A%209880%20B%2010236%20B%2096.52%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3ESRAM%3A%209528%20B%2016%20KB%2058.15%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EUSB_RAM%3A%200%20B%2016%20KB%200.00%25%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EFinished%20building%20target%3A%20LPC55S69_Bootloader.axf%3C%2FSPAN%3E%3C%2FPRE%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CP%3EI%20launched%20it%20again%2C%20with%20the%20same%20problem.%20It%20shows%20that%20it's%20erasing%20only%20the%200000-1FFF%20range%2C%20and%20it%20fails.%20So%20whatever's%20going%20on%20seems%20to%20be%20related%20to%20how%20it%20determines%20which%20ranges%20to%20erase%20and%20how%20it%20verifies%20the%20upload.%3C%2FP%3E%3CP%3EThis%20seems%20to%20be%20a%20recent%20thing%20(I'm%20running%20MCUX%20v25.6%20build%20136)%20and%20my%20hunch%20is%20that%20it%20feels%20like%20all%20of%20the%20other%20unreliable%2C%20quirky%20debug%20behavior%20I've%20encountered%20with%20MCUX%20because%20the%20IDE%20just%20has%20bad%20integration%20with%20gdb.%20Here's%20how%20the%20session%20ends%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CPRE%3E%3CSPAN%3EPEmicro%20GDB%20Launch%20Failure%20%3A%20Error%20during%20flash%20programming.%20Terminating%20debug%20session.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EPE-ERROR%3A%20Error%20downloading%20to%20the%20device.%20Terminating%20debug%20session.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EDisconnected%20from%20%22127.0.0.1%22%20via%20127.0.0.1.%20Disconnection%20by%20port%20%2252065%22%20from%206225%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EDisconnected%20from%20%22127.0.0.1%22%20via%20127.0.0.1.%20Disconnection%20by%20port%20%2252070%22%20from%207225%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EINFO%3A%20DAP%20IDCODE%20%3D%200x6BA02477%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3ETarget%20Disconnected.%3C%2FSPAN%3E%3C%2FPRE%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CP%3EExcept%20it%20doesn't%20actually%20end%20-%20I%20can%20hear%20the%20CPU%20fan%20kick%20on%20and%20arm-none-eabi-gdb.exe%20consumes%20100%25%20CPU%20time%20on%20one%20core.%20Here's%20gdb's%20output%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CPRE%3E611%2C647%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%20%26amp%3B%22load%20B%3A%5C%5C%5C%5Chome%5C%5C%5C%5Ceb6%5C%5C%5C%5Cbootloader%5C%5C%5C%5CDebug%5C%5C%5C%5CLPC55S69_Bootloader.axf%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%20~%22Loading%20section%20.text%2C%20size%200x130%20lma%200x0%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%2026%2Bdownload%2C%7Bsection%3D%22.text%22%2Csection-size%3D%22304%22%2Ctotal-size%3D%221801748%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%2026%2Bdownload%2C%7Bsection%3D%22.text%22%2Csection-sent%3D%22304%22%2Csection-size%3D%22304%22%2Ctotal-sent%3D%22304%22%2Ctotal-si%5C%3CBR%20%2F%3E%3CBR%20%2F%3Eze%3D%221801748%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%20~%22Loading%20section%20.commands%2C%20size%200x3c%20lma%200x9ae00%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%2026%2Bdownload%2C%7Bsection%3D%22.commands%22%2Csection-size%3D%2260%22%2Ctotal-size%3D%221801748%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%20~%22Loading%20section%20.startvector%2C%20size%200x4%20lma%200x9b000%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%2026%2Bdownload%2C%7Bsection%3D%22.startvector%22%2Csection-size%3D%224%22%2Ctotal-size%3D%221801748%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%20~%22Loading%20section%20.text%2C%20size%200x2690%20lma%200x9b004%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C648%2026%2Bdownload%2C%7Bsection%3D%22.text%22%2Csection-size%3D%229872%22%2Ctotal-size%3D%221801748%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C650%20~%22Loading%20section%20.data%2C%20size%200x8%20lma%200x9d694%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C650%2026%2Bdownload%2C%7Bsection%3D%22.data%22%2Csection-size%3D%228%22%2Ctotal-size%3D%221801748%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C663%2027interpreter-exec%20mi2%20%22-break-insert%20-t%20-f%20main%22%3CBR%20%2F%3E%3CBR%20%2F%3E611%2C788%2028-list-thread-groups%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20%26amp%3B%22Error%20finishing%20flash%20operation%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%2026%5Eerror%2Cmsg%3D%22Error%20finishing%20flash%20operation%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20%26amp%3B%22monitor%20selectcore%200%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20%40%22Command%20Executed%20successfully%3A%20selectcore%200%5Cr%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20%5Edone%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C695%20%26amp%3B%22interpreter-exec%20mi2%20%5C%22-break-insert%20-t%20-f%20main%5C%22%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C702%20%26amp%3B%22warning%3A%20could%20not%20convert%20'main'%20from%20the%20host%20encoding%20(CP1252)%20to%20UTF-32.%5CnThis%20normall%5C%3CBR%20%2F%3E%3CBR%20%2F%3Ey%20should%20not%20happen%2C%20please%20file%20a%20bug%20report.%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C702%20%26amp%3B%22%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%20~%22Note%3A%20automatically%20using%20hardware%20breakpoints%20for%20read-only%20addresses.%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%20%5Edone%2Cbkpt%3D%7Bnumber%3D%221%22%2Ctype%3D%22breakpoint%22%2Cdisp%3D%22del%22%2Cenabled%3D%22y%22%2Caddr%3D%220x0009b138%22%2Cfunc%3D%22main%5C%3CBR%20%2F%3E%3CBR%20%2F%3E%22%2Cfile%3D%22..%2Fsource%2FLPC55S69_Bootloader.c%22%2Cfullname%3D%22B%3A%5C%5Chome%5C%5Ceb6%5C%5Cbootloader%5C%5Csource%5C%5CLPC55S6%5C%3CBR%20%2F%3E%3CBR%20%2F%3E9_Bootloader.c%22%2Cline%3D%22150%22%2Cthread-groups%3D%5B%22i1%22%5D%2Ctimes%3D%220%22%2Coriginal-location%3D%22main%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%2027%5Edone%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%2029flushreg%3CBR%20%2F%3E%3CBR%20%2F%3Econtinue%3CBR%20%2F%3E%3CBR%20%2F%3Emonitor%20refreshviews%3CBR%20%2F%3E%3CBR%20%2F%3Econtinue%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%2028%5Edone%2Cgroups%3D%5B%7Bid%3D%22i1%22%2Ctype%3D%22process%22%2Cpid%3D%2242000%22%2Cexecutable%3D%22B%3A%5C%5Chome%5C%5Ceb6%5C%5Cbootlo%5C%3CBR%20%2F%3E%3CBR%20%2F%3Eader%5C%5CDebug%5C%5CLPC55S69_Bootloader.axf%22%7D%5D%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%20%26amp%3B%22flushreg%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C705%20~%22Register%20cache%20flushed.%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C707%2030-list-thread-groups%20i1%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%2029%5Edone%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%20%26amp%3B%22continue%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%20~%22Continuing.%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%20%5Erunning%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%20*running%2Cthread-id%3D%22all%22%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C721%20(gdb)%3CBR%20%2F%3E%3CBR%20%2F%3E615%2C766%20%26amp%3B%22warning%3A%20Exception%20condition%20detected%20on%20fd%20528%5Cn%22%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FPRE%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CP%3EAnd%20if%20you'll%20recall%20from%20my%20last%20message%2C%20the%20GUI%20flash%20tool%20similarly%20doesn't%20properly%20register%20fault%20conditions.%3C%2FP%3E%3CP%3EFor%20now%20I'm%20up%20and%20running%20by%20excluding%20my%20bootloader%20from%20the%20.ld%20file.%3C%2FP%3E%3CP%3ELet%20me%20know%20what%20you%20think%20about%20the%20non-contiguous%20memory%20erase%2Fverify%20problem.%20And%20I%20would%20be%20happy%20to%20help%20your%20developers%20with%20testing%20fixes%20to%20the%20gdb%20integration%20because%20that's%20been%20a%20constant%20headache%20for%20years.%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EScott%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201214%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201214%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThere's%20definitely%20something%20more%20going%20on%20than%20pins%20getting%20reassigned.%20Debugging%20in%20MCUXpresso%20has%20always%20been%20very%20unreliable%20for%20me%20and%20I'd%20love%20to%20get%20to%20the%20bottom%20of%20it.%20It%20was%20working%20fine%20for%20the%20first%20half%20of%20the%20day.%20I%20made%20a%20minor%20change%20(enabling%20the%20FreeRTOS%20vApplicationMallocFailed()%20hook%20and%20defining%20a%20function%20with%20__BKPT(0))%20and%20haven't%20been%20able%20to%20load%20and%20debug%20anything%20since%2C%20with%20either%20the%20Cyclone%20or%20LPC-Link2.%3C%2FP%3E%3CP%3EThe%20connection%20is%20fine.%20And%20in%20fact%20I'm%20able%20to%20connect%20with%20PROGACMP%20and%20erase%20the%20device%2C%20and%20verify%20that%20it's%20erased.%20It's%20coming%20back%20all%2000%20when%20on%20most%20devices%20I%20expect%20FF%2C%20so%20I%20don't%20know%20if%20that's%20right%2C%20but%20it's%20at%20least%20passing%20the%20blank%20check.%3C%2FP%3E%3CP%3EEven%20with%20an%20erased%20device%2C%20I%20can't%20do%20anything%20with%20it.%20Here's%20what%20I%20get%20with%20the%20GUI%20flash%20tool.%20There%20are%20a%20few%20things%20going%20on%20here%20-%20first%2C%20the%20dialog%20indicates%20it%20completed%20when%20the%20log%20shows%20that%20it%20failed.%20And%20from%20the%20log%20you%20can%20see%20that%20it's%20got%20the%20wrong%20range%2C%20or%20at%20least%20not%20the%20complete%20range.%3C%2FP%3E%3CP%3EI%20can%20also%20use%20the%20Cyclone%20to%20program%20a%20known-good%20image%20and%20the%20device%20runs%2C%20but%20I%20still%20can't%20do%20anything%20from%20MCUX.%3C%2FP%3E%3CP%3EI'm%20going%20to%20reboot%20now%20and%20see%20if%20that%20makes%20any%20difference.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22scottm_0-1762646822793.png%22%20style%3D%22width%3A%20718px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22scottm_0-1762646822793.png%22%20style%3D%22width%3A%20718px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364517i30C593BD8DFEFC3F%2Fimage-dimensions%2F718x644%3Fv%3Dv2%22%20width%3D%22718%22%20height%3D%22644%22%20role%3D%22button%22%20title%3D%22scottm_0-1762646822793.png%22%20alt%3D%22scottm_0-1762646822793.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2198037%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2198037%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20might%20work%20for%20the%20LPCxpresso55S69%20board%2C%20but%20it%20doesn't%20help%20with%20any%20of%20my%20own%20boards.%20With%20MON08%20and%20BDM%20debuggers%20on%20older%20MCUs%20there%20was%20always%20a%20way%20to%20mass%20erase%20the%20flash%20no%20matter%20what%20was%20loaded%20-%20it'd%20go%20into%20debug%20mode%20right%20out%20of%20reset.%20Is%20SWD%20just%20not%20capable%20of%20that%3F%3C%2FP%3E%0A%3CP%3EThis%20occurs%20because%20during%20the%20process%20of%20connecting%20the%20debugger%20to%20the%20chip%2C%20the%20chip%20is%20reset%20and%20then%20executes%20code%20from%20its%20flash%20memory.%20Since%20the%20customer's%20code%20modifies%20the%20SWD-related%20I%2FO%20functions%20during%20this%20process%2C%20it%20ultimately%20causes%20the%20debugger%20connection%20to%20fail.%20This%20is%20why%20erasing%20part%20of%20the%20flash%20at%20starting%20position%20resolves%20the%20issue.%3CBR%20%2F%3E%3CBR%20%2F%3ERegarding%20the%20size%20of%20the%20flash%2C%20it%20should%20be%20631.5%20KB%2C%20the%20last%2017%20pages(8.5%20KB)%20are%20reserved%2C%20I%20am%20currently%20confirming%20this%20internally.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2196308%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2196308%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Harry%2C%3C%2FP%3E%3CP%3EThat%20might%20work%20for%20the%20LPCxpresso55S69%20board%2C%20but%20it%20doesn't%20help%20with%20any%20of%20my%20own%20boards.%20With%20MON08%20and%20BDM%20debuggers%20on%20older%20MCUs%20there%20was%26nbsp%3B%3CEM%3Ealways%3C%2FEM%3E%20a%20way%20to%20mass%20erase%20the%20flash%20no%20matter%20what%20was%20loaded%20-%20it'd%20go%20into%20debug%20mode%20right%20out%20of%20reset.%20Is%20SWD%20just%20not%20capable%20of%20that%3F%3C%2FP%3E%3CP%3EIn%20the%20course%20of%20troubleshooting%20this%20I've%20run%20into%20some%20other%20issues%20I'm%20following%20up%20on.%20When%20I%20wrote%20this%20bootloader%20back%20in%202023%2C%20I%20noticed%20that%20the%20LPC55S69%20documentation%20was%20ambiguous%20about%20the%20top%20of%20usable%20flash%20memory%20-%20in%20one%20place%20it%20says%2016%20pages%20%2F%2010%20kB%20are%20reserved%20and%20in%20another%20it%20says%2017%20pages%20%2F%2010%20kB.%2016%20pages%20would%20be%208%20kB%20and%2017%20pages%20is%208.5%20kB%2C%20so%20obviously%20something's%20wrong%20there.%3C%2FP%3E%3CP%3EAs%20far%20as%20anyone%20can%20tell%2C%20the%20correct%20top%20of%20memory%20is%200x9d800.%20When%20I%20checked%20the%20debugger%20memory%20configuration%20files%2C%20the%20top%20was%20given%20as%200x98000%2C%20which%20is%20definitely%20wrong.%20I%20reported%20this%20in%20a%20thread%20back%20in%202023.%3C%2FP%3E%3CP%3EApparently%20those%20memory%20configurations%20were%20fixed%20at%20some%20point%20(though%20there's%20still%20no%20updated%20errata%20for%20the%20LPC55S69)%20but%20I%20discovered%20that%20my%20project%20file%20kept%20the%20old%20(incorrect)%20settings.%20While%20trying%20to%20sort%20it%20out%2C%20I%20ended%20up%20uninstalling%20all%20versions%20of%20MCUXpresso%20and%20Linkserver%20and%20deleted%20all%20of%20my%20launch%20configurations%20and%20then%20after%20reinstalling%20discovered%20that%20the%20project%20also%20seemed%20to%20be%20referencing%20an%20out-of-date%20Linkserver.%20P%26amp%3BE's%20drivers%20are%20harder%20to%20sort%20out%20because%20the%20Cyclone%20ACP%20isn't%20even%20listed%20on%20their%20site.%3C%2FP%3E%3CP%3ERecreating%20the%20entire%20project%20with%20the%20latest%20IDE%20would%20take%20hours%20of%20work%20to%20manually%20document%20and%20recreate%20all%20of%20the%20settings%20and%20then%20do%20regression%20testing.%20Do%20you%20know%20of%20any%20other%20places%20that%20out%20of%20date%20debugger%20references%20could%20be%20hiding%3F%20Something's%20definitely%20still%20wrong.%20At%20one%20point%20the%20only%20way%20I%20could%20get%20it%20to%20program%20was%20by%20using%20the%20P%26amp%3BE%20standalone%20PROGACMP%20utility%20-%20which%20proved%20that%20the%20MCU%20was%20responding%20just%20fine%20with%20the%20same%20debugger%20and%20the%20same%20connections%2C%20but%20through%20gdb%20it%20simply%20wasn't%20working.%20At%20the%20moment%20the%20only%20interface%20I%20can%20get%20to%20work%20reliably%20with%20the%20project%20is%20an%20old%20LPC-Link2%20I%20found%20in%20a%20drawer.%3C%2FP%3E%3CP%3ETo%20answer%20your%20question%2C%20this%20particular%20project%20is%20a%20multi-channel%20RoIP%20interface.%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EScott%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2195428%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2195428%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20think%20you%26nbsp%3B%20can%20put%20the%20chip%20into%20ISP%20mode%20and%20then%20use%20ISP%20commands%20to%20erase%20the%20first%201KB%20or%2010KB%20of%20the%20flash%20to%20corrupt%20the%20firmware%20header%2C%20preventing%20the%20chip%20from%20jumping%20to%20the%20firmware%2C%20and%20then%20connect%20using%20a%20debugger.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_0-1761794696831.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_0-1761794696831.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363159i442E23B0606FE041%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_0-1761794696831.png%22%20alt%3D%22Harry_Zhang_0-1761794696831.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20isp%20pin%20is%20PIO0_5.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_1-1761794736006.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_1-1761794736006.png%22%20style%3D%22width%3A%20354px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363160iDBC1D5E35FAA7FCC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_1-1761794736006.png%22%20alt%3D%22Harry_Zhang_1-1761794736006.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAnd%20then%20use%20blhost%20command.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_3-1761794780035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_3-1761794780035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363162i9124F9319881DAAA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_3-1761794780035.png%22%20alt%3D%22Harry_Zhang_3-1761794780035.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_2-1761794767276.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_2-1761794767276.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363161iD9858C2F065E498A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_2-1761794767276.png%22%20alt%3D%22Harry_Zhang_2-1761794767276.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBy%20the%20way%2C%20what%20is%20your%20application%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2194733%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2194733%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Harry%2C%3C%2FP%3E%3CP%3EThat%20didn't%20seem%20to%20change%20anything.%20I%20tried%20with%20one%20of%20the%20boards%20I%20haven't%20pulled%20the%20crystal%20from%20yet%2C%20that%20I%20bricked%20with%20the%20bad%20firmware%20load%2C%20and%20it's%20still%20unable%20to%20connect.%20I've%20tried%20similar%20settings%20for%20the%20P%26amp%3BE%20interface.%3C%2FP%3E%3CP%3EThe%26nbsp%3B%3CEM%3Eonly%3C%2FEM%3E%20change%20from%20the%20firmware%20versions%20that%20have%20worked%20for%20years%20is%20this%3A%3C%2FP%3E%3CP%3ESystemCoreClockUpdate()%3B%3CBR%20%2F%3EDbgConsole_Init(DEBUG_CONSOLE_SWO_PORT%2C%20DEBUG_CONSOLE_SWO_BAUDRATE%2C%20kSerialPort_Swo%2C%20SystemCoreClock)%3B%3C%2FP%3E%3CP%3EJust%20to%20make%20sure%20we're%20on%20the%20same%20page%2C%20can%20you%20confirm%20that%20there%26nbsp%3B%3CEM%3Eshould%3C%2FEM%3E%20still%20be%20a%20way%20to%20erase%20and%20reload%20a%20device%20as%20long%20as%20flash%20protection%20isn't%20enabled%3F%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EScott%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2193947%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2193947%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20SWD%20debugging%20interface%20of%20LPC55S69%20depends%20on%20the%20clock.%3CBR%20%2F%3EYour%20code%20may%20have%20changed%20the%20debugging%20clock%20or%20PIN%20MUX%20when%20switching%20to%20an%20external%20crystal%20oscillator%20and%20enabling%20SWO%20in%20the%20later%20stage%20of%20main()%2C%3CBR%20%2F%3ECausing%20the%20debugging%20port%20to%20lose%20clock%2C%20making%20it%20impossible%20for%20the%20debugger%20to%20reconnect%20or%20erase.%3C%2FP%3E%0A%3CP%3ESo%20i%20think%20you%20can%20try%20to%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EUse%20your%20debug%20probe%E2%80%99s%20Connect%20under%20Reset%20on%20connection%20option.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIn%20MCUXpresso%20IDE%2C%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_0-1761623987372.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_0-1761623987372.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F362812iFBD5605AB634922F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_0-1761623987372.png%22%20alt%3D%22Harry_Zhang_0-1761623987372.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2192773%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2192773%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Harry%2C%3C%2FP%3E%3CP%3EIt's%20not%20enabling%20it%20early%20in%20the%20boot%20process.%20It%20happens%20in%20main()%2C%20after%26nbsp%3B%3CSPAN%3EBOARD_InitBootPins()%20and%26nbsp%3BBOARD_InitBootClocks().%20That's%20the%20only%20way%20I%20was%20able%20to%20recover%20it%20-%20because%20it%20was%20after%20the%20switch%20to%20the%20external%20crystal%2C%20I%20could%20desolder%20the%20crystal%20and%20make%20sure%20it%20hung%20there%20forever.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EShouldn't%20the%20debugger%20be%20able%20to%20at%20least%20perform%20a%20mass%20erase%20regardless%20of%20what%20the%20target%20is%20doing%3F%20How%20do%20I%20recover%20an%20MCU%20like%20this%20if%20I'm%20not%20able%20to%20stop%20it%20by%20pulling%20the%20crystal%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EScott%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2192501%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20bricked%20after%20trying%20to%20enable%20SWO%20debug%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2192501%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126981%22%20target%3D%22_blank%22%3E%40scottm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAccording%20to%20your%20description%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20you%20enabled%20SWO%20output%26nbsp%3B%20and%20reconfigured%20the%20debug%20console%2C%20you%20most%20likely%20modified%20the%20clock%20source%20or%20pin%20muxing%20in%20a%20way%20that%20unintentionally%20affected%20the%20SWD%2FSWO%20pins%26nbsp%3B%20or%20the%26nbsp%3B%20debug%20clock%20domain.%3C%2FP%3E%0A%3CP%3EWhen%20you%20reset%20and%20power%20up%3A%3C%2FP%3E%0A%3CP%3EIf%20your%20firmware%20reconfigures%20clocks%2C%20pins%2C%20or%20secure%20settings%20very%20early%20(e.g.%20before%20SystemInit()%20finishes)%2C%3C%2FP%3E%0A%3CP%3Ethe%20debugger%20never%20gets%20a%20chance%20to%20run%20before%20the%20MCU%20becomes%20unreachable.%3C%2FP%3E%0A%3CP%3ESo%20i%20think%20you%20can%20disable%20swo%20in%20early%20boot.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E