Skip to content

Conversation

@JojoS62
Copy link

@JojoS62 JojoS62 commented Jan 31, 2025

Summary of changes

Add JLink and pyocd as upload methods for LPC1768 target

Impact of changes

Migration actions required

Documentation


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[x] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

@multiplemonomials
Copy link
Collaborator

multiplemonomials commented Jan 31, 2025

Were you able to get pyocd to work on LPC1768? I claim that it doesn't work on the actual LPC1768 board.

I think what we might want to do here is break up the LPC1768 target:

  • create MCU_LPC17xx which contains almost all the current LPC1768 code except for PinNames.h
  • make LPC1768 (the Mbed board) a child of the MCU_LPC17xx target
  • Create a new LPCXPRESSO_LPC1769 target which has its own upload method configs, device_name, and PinNames.h

@JojoS62
Copy link
Author

JojoS62 commented Jan 31, 2025

Were you able to get pyocd to work on LPC1768?

yes, it works with the cheap cmsis-dap probe, flashing the target and also debugging. Although debugging (stepping) is a little bit slower than openOCD and JLink, it is able to show threads, which the other upload methods do not. So I think it is ok to add pyocd, but the possible problems should be mentioned in the documentation.

But about the targets you are right, it is cleaner to add a seperate LPCXpresso target, but as 2nd step, not in this PR.

  • make LPC1768 (the Mbed board) a child of the MCU_LPC17xx target

It is already defined like this, only the name LPC1768 was chosen badly. But I don't want to break compatibility, this should be kept as it is.
And the base is MCU_LPC1768, it would be better to name it MCU_LPC176x. But I'm afraid also about side effects. The only difference is the clock frequency, LPC1769 can run at 120 MHz, 1768 only at 100 MHz. Current clock is set to 96 MHz, I assume for USB.

JLink:
image

pyocd:
image

@multiplemonomials
Copy link
Collaborator

Are those above screenshots with the actual real Mbed LPC1768 board? AFAIK, that board doesn't have a debug connector, so you have to use the (very old) CMSIS DAP interface chip on the board.

I really would like to split the targets up if at all possible. I don't believe that creating an MCU_LPC17XX parent target would create compatibility issues, because the LPC1768 target would still exist, just as a child of this target... right?

@multiplemonomials
Copy link
Collaborator

If you need, LPC1768 clock config lives here:

I think you can change the #defines on those lines to increase the CPU freq!

@JojoS62
Copy link
Author

JojoS62 commented Jan 31, 2025

If you need, LPC1768 clock config lives here:

I think you can change the #defines on those lines to increase the CPU freq!

yes, I found it already too. I've set the MCB1700 define and the clock is set to 100 MHz

@JojoS62
Copy link
Author

JojoS62 commented Jan 31, 2025

Are those above screenshots with the actual real Mbed LPC1768 board? AFAIK, that board doesn't have a debug connector, so you have to use the (very old) CMSIS DAP interface chip on the board.

I really would like to split the targets up if at all possible. I don't believe that creating an MCU_LPC17XX parent target would create compatibility issues, because the LPC1768 target would still exist, just as a child of this target... right?

no, it was from the lpcxpresso with debugger cuted off, so that others can be used.

So you're right, its better to create a new target. but I would use the existing parent. LPC17xx includes many more, I have only the LPC176x for testing.

edit:
ok, I think about it. By using the existing parent MCU_LPC1768 there is the confusion with the name.

@JojoS62
Copy link
Author

JojoS62 commented Feb 1, 2025

closing as discussed, I will prepare a new PR for adding MCU_LPC176X and LPCXPRESSO_LPC1769 as new target

@JojoS62 JojoS62 closed this Feb 1, 2025
@JojoS62 JojoS62 deleted the add-upload-jlink-lpc1768 branch February 2, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants