-
-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the LPC54102 series #2525
Conversation
This commit adds the YAML file generated by the great `target-gen`-tool provided in this repository (using the following command): ```shell $ target-gen arm -f LPC54102 probe-rs/targets ``` This is a sub-series of the LPC54xxx microcontrollers: the [datasheet] groups the LPC54102 chips of this commit together with the LPC54101- chips, which are different as they don't have a secondary Cortex-M0+- core. Therefore they have a different CMSIS-pack and should be in a separate file. [datasheet]: https://www.nxp.com/docs/en/data-sheet/LPC5410X.pdf
Thanks! Have you by chance verified whether the flash algos actually work? I have a slight worry that we may connect to the M0+ core by default, and if the algos are written for M4 there might be problems. You can also constrain the algorithms to the M4 core, but currently I'd recommend just commenting out the M0+ cores. |
I currently just start to develop a new application, so I just start to do something with the new chip, but: $ cargo flash --chip LPC54102J512BD64
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
Flashing /home/jfrimmel/git/testapp/target/thumbv7em-none-eabihf/debug/testapp
Erasing ✔ [00:00:00] [########################################] 32.00 KiB/32.00 KiB @ 132.88 KiB/s (eta 0s )
Programming ✔ [00:00:00] [###########################################] 5.00 KiB/5.00 KiB @ 10.06 KiB/s (eta 0s ) Finished in 0.794s
WARN probe_rs::architecture::arm::core::armv6m: Expected core to be halted, but core is running Notice the $ cargo flash --chip LPC54102J512BD64
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s
Flashing /home/jfrimmel/git/testapp/target/thumbv7em-none-eabihf/debug/testapp
Erasing ✔ [00:00:00] [########################################] 32.00 KiB/32.00 KiB @ 121.12 KiB/s (eta 0s )
Programming ✔ [00:00:00] [############################################] 5.00 KiB/5.00 KiB @ 9.06 KiB/s (eta 0s ) Finished in 0.873s Thus a general question arises: how does |
The important bits right now are that the default core is the first that is defined in the target YAML, so switching their order might work. All cores are accessable with |
Would you like to:
I'm in favor of one of the first two, though. |
I'm perfectly happy with switching the order of the cores. Limited support is better than no support :) |
Oh, no... I did some testing locally and even with the cores changed, the "wrong" core is used: $ cargo flash --chip LPC54102J512BD64
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
Flashing /home/jfrimmel/git/testapp/target/thumbv7em-none-eabihf/debug/testapp
Erasing ✔ [00:00:00] [########################################] 32.00 KiB/32.00 KiB @ 133.45 KiB/s (eta 0s )
Programming ✔ [00:00:00] [###########################################] 5.00 KiB/5.00 KiB @ 10.11 KiB/s (eta 0s ) Finished in 0.791s
WARN probe_rs::architecture::arm::core::armv6m: Expected core to be halted, but core is running As you can see, there is the Therefore I'll go one and comment out the Cortex-M0+. (sorry for the noise) |
I'm not sure if that warning is too important here. It might be that the M0+ needs some special attention and we'll need to add a custom debug sequence for these chips, but also warnings aren't errors. As long as the flash algo runs on the main core, and things seem to work (i.e. for example Multi-core chips are slightly tricky because halting/resuming them is completely implementation-specific. Multi-architecture may or may not throw one more wrench into the story. |
Okay, here is a minimal application with RTT output: #[cortex_m_rt::entry]
fn main() -> ! {
rtt_target::rtt_init_print!();
rtt_target::debug_rprintln!("Hello, world!");
cortex_m_semihosting::debug::exit(cortex_m_semihosting::debug::EXIT_SUCCESS);
loop {
unsafe { core::arch::asm!("wfe") };
}
} I've done two tests:
So I would deduce, that we do need to comment out the Cortex-M0+ core, as at least some tools will pick the wrong core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This commit adds the YAML file generated by the great
target-gen
-tool provided in this repository (using the following command):This is a sub-series of the LPC54xxx microcontrollers: the datasheet groups the LPC54102 chips of this commit together with the LPC54101- chips, which are different as they don't have a secondary Cortex-M0+- core. Therefore they have a different CMSIS-pack and should be in a separate file.