Mbed studio: Nuvoton M2354: build failed

Description of defect

On ARM 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: 17dc3dc2e6e2817a8bd3df62f38583319f0e4fed

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 ?

  1. Log in Mbed Studio
  2. Click File > New Program > mbed-os-example-blinky > Add Program
  3. Update library to mbed-os-6.17.0 if not yet
  4. Specify NUMAKER-M2354 as target hardware
  5. Build failed with log:

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

Hello,

two things what are wrong here I think.

First:
You wrote “Build failed”, but

Image: BUILD/NU_M2354/ARMC6\mbed-os-example-blinky.bin

that seems the build was successful. The rest under this line are information about unsuccessful deploy to your board.

Second:
You should post this to Mbed Studio section, because it is related to Mbed Studio and not to MbedOS.
I saw also your issue on github

There seems to be real build issue in Keil Studio Cloud - keil studio: m2354: build failed · Issue #15351 · ARMmbed/mbed-os (github.com), however in this issue is also written

But on Mbed Studio or Mbed CLI, build is fine.

Try DAP Link Interface Firmware Update.

BR, Jan

1 Like