-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Mbed studio: Nuvoton M2354: build failed #15417
Comments
@lunchboxwu thank you for raising this issue.Please take a look at the following comments: Could you add some more detail to the description? A good description should be at least 25 words. NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered. |
cc @ARMmbed/team-nuvoton |
The error log is related to pyocd. Currently, M2354 board's NuLink2 doesn't support flash or debug on Mbed Studio. Just build code only, that is, on Mbed Sutdio, click Build program, neither Run program nor Debug program. To flash code, go USB drag-and-drop programming. |
@ccli8 please esnure Nu-Link2 with correct F/W and mbed-studio with up-to-date pyOCD pack. |
After checking, Nu-Link2 default F/W is for normal drag-drop & mbed green-tea test support. |
This is necessary. However, Mbed Studio's inbuilt pyOCD version 0.30.2 hasn't supported M2354. Upgrade this inbuilt pyOCD to latest version manually may break Mbed Studio. So Flash & Debug for M2354 are still not supported on Mbed Studio. |
Manual upgrade pyocd is relative to python site package, for ex "
In mbed studio environment console, it should reach python path and could manual update by " |
Yes. In Mbed Studio, open builtin console through Terminal > New Terminal and run like |
Mbed Studio Debug, based on pyOCD, requires Mbed OS application code starting on the sector boundary. Modification list: 1. Update TF-M import assets with MCUboot header padding to sector aligned 2. Following above, change header size argument (-H) in wrapper.py command line Related issue: ARMmbed#15417
In Mbed Studio, debugging, based on pyOCD, requires Mbed OS application code starting on the sector boundary. Modification list: 1. Update TF-M import assets with MCUboot header padding to sector aligned 2. Following above, change header size argument (-H) in wrapper.py command line 3. Following below, fix min-write-size (--align) to 4 (per flash_area_align()) in wrapper.py command line https://docs.mcuboot.com/design.html#image-trailer Related issue: ARMmbed#15417
In Mbed Studio, debugging, based on pyOCD, requires Mbed OS application code starting on the sector boundary. Modification list: 1. Update TF-M import assets with MCUboot header padding to sector aligned 2. Following above, change header size argument (-H) in wrapper.py command line 3. Following below, fix min-write-size (--align) to 4 (per flash_area_align()) in wrapper.py command line https://docs.mcuboot.com/design.html#image-trailer Related issue: ARMmbed#15417
To enable flashing and debugging M2354 on Mbed Studio, please follow the flow:
|
To extend pyOCD support for M2354 via CMSIS Pack, follow the procedure (verified on Windows 10):
|
In Mbed Studio, debugging, based on pyOCD, requires Mbed OS application code starting on the sector boundary. Modification list: 1. Update TF-M import assets with MCUboot header padding to sector aligned 2. Following above, change header size argument (-H) in wrapper.py command line 3. Following below, fix min-write-size (--align) to 4 (per flash_area_align()) in wrapper.py command line https://docs.mcuboot.com/design.html#image-trailer Related issue: ARMmbed#15417
This issue was fixed and could be closed. |
In Mbed Studio, debugging, based on pyOCD, requires Mbed OS application code starting on the sector boundary. Modification list: 1. Update TF-M import assets with MCUboot header padding to sector aligned 2. Following above, change header size argument (-H) in wrapper.py command line 3. Following below, fix min-write-size (--align) to 4 (per flash_area_align()) in wrapper.py command line https://docs.mcuboot.com/design.html#image-trailer Related issue: ARMmbed#15417
* Fix null pointer dereferencing Add null check for return values of functions that are mostly (but not always) checked for null. E.g., since 98% of calls to protocol_stack_interface_info_get_by_id check for null, it is likely that the function can return null values in some cases, and omitting the check could crash the program. * Update MAX32660 peripheral drivers with final ones that use by SDK * Apply MAX32660 delta Update mbed hal function as per of SDK update Signed-off-by: Sadik.Ozer <[email protected]> * M2354: Fix debug failure in Mbed Studio In Mbed Studio, debugging, based on pyOCD, requires Mbed OS application code starting on the sector boundary. Modification list: 1. Update TF-M import assets with MCUboot header padding to sector aligned 2. Following above, change header size argument (-H) in wrapper.py command line 3. Following below, fix min-write-size (--align) to 4 (per flash_area_align()) in wrapper.py command line https://docs.mcuboot.com/design.html#image-trailer Related issue: ARMmbed#15417 * Do not clear interrupt flag during initialization This causes issue for repeaded initialization while using BufferedSerial mode Signed-off-by: Sadik.Ozer <[email protected]> * MAX32660, MAX32670 UART performance improvement Signed-off-by: Sadik.Ozer <[email protected]> * Handle negative values passed to close() Calling close() with negative numbers causes out-of-bounds indexing of the filehandles array. For example, this can happen if open() returns an error and the value is later passed to close(). * Moved a { to the same line as if Moved a { to the same line as if * add nullpointer check in LWIP::socket_close * Fix crash when using FDCAN3 RX IRQ on STM32G473 (and others) * connectivity: drivers: Update Nuvoton M467 EMAC DMA_IE ctl In IRQ Handler, to disable some interrupt type of DMA error. It could avoid unexpected repeated interrupt.The masked bit of DMA_IE could be recovered in next EMAC IRQ event. Signed-off-by: cyliang tw <[email protected]> * Add workaround for G474 hardfault * update drivers STM32WL CUBE V1.3.0 * Changed static to weak * Fix: Do not disable SPI for manual drive mode during transaction setup It has been reported that disabling SPI module causes glitch for manual SS drive mode Signed-off-by: Sadik.Ozer <[email protected]> * make cellular event queue size configurable update unit tests --------- Signed-off-by: Sadik.Ozer <[email protected]> Signed-off-by: cyliang tw <[email protected]> Co-authored-by: Mingjie Shen <[email protected]> Co-authored-by: Ahmet Polat <[email protected]> Co-authored-by: Sadik.Ozer <[email protected]> Co-authored-by: Chun-Chieh Li <[email protected]> Co-authored-by: alrvid <[email protected]> Co-authored-by: Jost, Chris <[email protected]> Co-authored-by: Joseph Duchesne <[email protected]> Co-authored-by: cyliang tw <[email protected]> Co-authored-by: Maxim Markin <[email protected]> Co-authored-by: Charles <[email protected]> Co-authored-by: Lukas Karel <[email protected]>
Description of defect
On ARM Mbed Studio, targeting NUMAKER-M2354 v1.1 (NU_M2354), mbed-os-example-blinky (mbed-os 6.17.0) build failed with error log listed below. Tried other sample projects like mbed-os-empty with no avail either.
Target(s) affected by this defect ?
MCU: Nuvoton M2354
Board: NUMAKER-M2354 v1.1 (NU_M2354)
Toolchain(s) (name and version) displaying this defect ?
ARMC6
What version of Mbed-os are you using (tag or sha) ?
mbed-os 6.17.0
Commit: 17dc3dc
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
Mbed Studio: 1.4.5
How is this defect reproduced ?
Image: BUILD/NU_M2354/ARMC6\mbed-os-example-blinky.bin
0002874:CRITICAL:main:cannot read register r0 because core #0 is not halted
Traceback (most recent call last):
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd_main_.py", line 402, in run
self.COMMANDSself._args.cmd
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd_main.py", line 579, in do_flash
file_format=self._args.format)
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\file_programmer.py", line 157, in program
self._loader.commit()
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\loader.py", line 168, in commit
keep_unwritten=self._keep_unwritten)
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\builder.py", line 464, in program
flash_operation = self._chip_erase_program_double_buffer(progress_cb)
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\builder.py", line 706, in _chip_erase_program_double_buffer
self.flash.erase_all()
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\flash.py", line 345, in erase_all
result = self._call_function_and_wait(self.flash_algo['pc_eraseAll'])
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\flash.py", line 604, in _call_function_and_wait
return self.wait_for_completion()
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\flash\flash.py", line 600, in wait_for_completion
return self.target.read_core_register('r0')
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\soc_target.py", line 173, in read_core_register
return self.selected_core.read_core_register(id)
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 911, in read_core_register
regValue = self.read_core_register_raw(reg_info.index)
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 928, in read_core_register_raw
vals = self.read_core_registers_raw([reg])
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 949, in read_core_registers_raw
return self._base_read_core_registers_raw(reg_list)
File "c:\Users\lunch\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 967, in _base_read_core_registers_raw
self.core_number))
pyocd.core.exceptions.CoreRegisterAccessError: cannot read register r0 because core #0 is not halted
The text was updated successfully, but these errors were encountered: