-
Notifications
You must be signed in to change notification settings - Fork 25
Add building, flashing, and debugging support for CY8CPROTO_062S3_4343W #501
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
base: master
Are you sure you want to change the base?
Conversation
if(MBED_IS_STANDALONE) | ||
|
||
# Always print output on test failure | ||
list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure) |
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 should be a big quality of life improvement :)
# Mbed OS upload method configuration file for target ARDUINO_GIGA_CM7. | ||
# To change any of these parameters from their default values, set them in your build script between where you | ||
# include app.cmake and where you add mbed os as a subdirectory. | ||
# include mbed_toolchain_setup and where you add mbed os as a subdirectory. |
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.
It was bothering me that all these files still mentioned the old app.cmake name, so I batch updated them.
|
||
# Give chance to adjust MBED_UPLOAD_LAUNCH_COMMANDS or MBED_UPLOAD_RESTART_COMMANDS | ||
# for debug launch | ||
if(COMMAND mbed_adjust_upload_debug_commands) | ||
mbed_adjust_upload_debug_commands(${target}) | ||
endif() | ||
|
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.
Suggest keeping invoking mbed_adjust_upload_debug_commands
if it is defined. Nuvoton has one bootloader example, which needs to modify MBED_UPLOAD_LAUNCH_COMMANDS
via mbed_adjust_upload_debug_commands
.
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.
Ah yeah, I think I see what you are trying to do (load the merged hex file instead of the regular one). There is an easier way to do that, by just calling the gen_upload_target()
function directly https://github.com/zhiyong-ft/mcuboot/blob/6723e39d45af70b6e75f7defc556a8587d509bf8/boot/mbed/mcuboot_imgtool.cmake#L153
Also, how come Nuvoton has its own mcuboot example? We have a Mbed OS MCU-Boot example here: https://github.com/mbed-ce/mbed-mcuboot-bootloader . I would really love if we could merge these two repos together and you could add the Nuvoton board configurations to the mbed_app.json in our repo.
And yeah regarding this change, I really would like to get rid of this function as it causes a lot of issues with trying to change the debug commands after a project is configured the first time, which is an unacceptable level of confusion for users in my opinion.
Summary of changes
I picked up an Infineon PSoC 62 dev kit a while back, and finally got around to trying it with Mbed. Getting it working was a little bit of an adventure (as some new features had to be added to support multicore CPUs), but I have building, flashing, and debugging working now!
Made the following changes:
monitor program
instead ofload
with OpenOCD, as the former works with this target while the latter does not.MCU_PSOC62_CM4
andMCU_PSOC64_CM4
their own target families to better reflect how the devices are organizedOpenOCD_SCRIPT_DIR
entirely. I added this a long time ago, before I realized that you could just pass OpenOCD scripts by relative path. This variable made it hard to switch the version of OpenOCD in use, because you had to set bothOpenOCD
andOpenOCD_SCRIPT_DIR
on the command line, so removing it improves usability by a lot.mbed_adjust_upload_debug_commands()
. This function, I found out, had a significant issue, which is that the way it used cache variables made it impossible to modify MBED_UPLOAD_LAUNCH_COMMANDS after the first time CMake was run! Looking at it, it seemed a lot simpler to make this function into a getter that doesn't modify the global variable, as it's only used in two places.Note that I did not run the test suite yet as there still seem to be a few issues to fix there. But I will do that next.
Impact of changes
Migration actions required
Documentation
Updated the doc site with the new upload method variables!
Pull request type
Test results
I have verified that I can flash and debug using VS Code and the command line (sadly not CLion as it doesn't allow the same level of customization of the GDB init sequence...). Also verified that the wifi firmware does boot (though the wifi tests are still hardfaulting, need to investigate why in a subsequent PR).