-
Notifications
You must be signed in to change notification settings - Fork 3k
Add support for MCUXpresso inside mbed exporter #4819
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 MCUXpresso inside mbed exporter #4819
Conversation
Signed-off-by: Mahadevan Mahesh <[email protected]>
5204572
to
2ce7b2a
Compare
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.
This is a good start: from https://github.com/ARMmbed/Handbook/blob/5.5/docs/cont/adding_exporters.md
We get the following checklist, with things that you have done checked off:
- takes input from the resource scan
- uses the flags in the build profiles
(I don't see any flag passing in yourIt's there, but not used as far as I can tell.ctx
variable) - has a single template file for each file type (you have a single template designed only to work with a single target; instead this should be a single template for working with many targets)
- Does not call mbed CLI
RE: flags You should be able to get the flags provided to the complier by mbed CLI in your exporter class through the variable |
RE: single template I would do this after the flags requirement. It looks like you have a project xml escaped within the .cproject file. This file-in-a-file looks like it contains a tonne of configuration for the MCU. I would see how much of this can be inferred by the plugin using this configuration. I would guess that it really only needs the MCU name and family, and could generate the rest of that information in some way (it does this when you create a project after all). |
|
@JojoS62 I was asking about what happens when you only provide the MCU, without any of that other configuration. That is useful info though. |
Also, I think LCPXpresso and KDS are being merged into MCUXpresso. In that case, it makes sense to drop the old versions of the IDEs, and support the new, unified IDE. |
yes, I agree. I could already verify (and this is also documented by NXP) that a LPCX project can be read by MCUX. In reverse, you get some errors when trying to import a project in LPCX that was saved by MCUX. |
Hi First of all, thank you for your contribution! I try to watch closely mbed-os's Python code because I believe it could be greatly improved. Therefore here are a few tips to make your code more Pythonic:
|
@Nodraak You tagged the wrong person. @mmahadevan108 is the author. @mmahadevan108 Please take note of @Nodraak's comment. |
@mmahadevan108 @theotherjimmy I use also a forced zip file option by setting zip_proj = True in the project.py. This worked somehow, but I got an error after merging updates for fixing static files. I think this is an error, some incompatible types were added. |
@JojoS62 As long as the second template is easy to maintain, that sounds great! |
I have already merged some of the gae stuff into the xpresso template and get the debug, develop and release configurations. Compiling works, calling the linker fails. The cproject template is really hard to read.... |
Agreed, but I don't think I could do much better, or better at all really. |
@ilg-ul I have used your exporter code and want to modify it for using it with LPC/MCUXpresso, also eclipse based IDE's. I hope this is ok for you, the copyrights and your name as original author will be kept. This creates already some readable output: https://github.com/JojoS62/mbed-os/tree/add_MCUXpresso_exporter
As far as I understand the cdt scanner should add the object files to the linker command. I have compared the created .cproject file with a good one, but I cannot find the magic difference. A sample created file for the LPC4088 is attached. The settings page for the tools shows a yellow eclamation mark but no error text, so I guess some option is recognized, but this seems to be a minor error.
Do you have some more information about the .cproject file contents? |
unfortunately not. :-( although not related to your problem, one advice: for portability reasons, do not generate Eclipse projects with backslash path separators. (for example in the |
Thanks for your fast reply. |
then the gnuarmeclipse has a small problem and should be fixed. I personally do not use Mbed, and the only tests I did were on macOS, where the paths were ok, so I had no chance to encounter the problem.
did you try on a POSIX environment too? but even if it works, it is still recommended to use POSIX portable paths. |
I agree, but the fix should be done where the exclude_folders is created. I'm using windows and have no Linux/Mac installation, but maybe @theotherjimmy can help with this issue. More confusing is the eclipse scanner configuration, I have some different projectfiles and cannot find a simple default. |
@JojoS62 Yes, I can definitely help. On the other hand, you have already provided a fix! Would you like to make that commit you referenced into a PR? I approve it 👍 . |
Yes, I want to make a PR, but there are some more details I want to fix as commented in my commit. The problem with linking was the missing linker script file. |
I'm glad that you found the problem.
You can always ask. That file might not be very important to keep closed source. But, they are not likely to give it to you.
Excellent! I look forward to your PR. Back on topic @mmahadevan108 Do you need any help from me? |
This is being discussed in the below PR |
Add support for MCUXpresso inside mbed exporter
Status
**READY
[ ] Tests
Tested with the LPCXpresso54114 board