AmebaD IAR SDK build failed

Hi,

I’m facing issue with AmebaD IAR project SDK build failed with below message.

Fatal Error[Li001]: could not open file “C:\Users\PC-01\Desktop\New folder (2)\ambd_sdk-master\project\realtek_amebaD_va0_example\EWARM-RELEASE\ C:\Users\PC-01\AppData\Local\Temp\EW32C8.tmp 1
Debug\Exe\km0_image\lib_application_lp.a” (failed opening file: The system cannot find the file specified.

: iostream stream error)
Error while running Linker

Any suggestion ?

Regards,

1 Like

Thanks for the feedback, this has been noted and handled by engineer at the moment

1 Like

Thanks for your support!
I wonder that the file lib_application_lp.a is missing from SDK release package ?
or this file will be create during build time ?

I try to search the file lib_application_lp.a in all SDK folder and found it in \GCC-RELEASE\project_lp\asdk\lib\application.

Then, I copy this file to EWARM-RELEASE\Debug\Exe\km0_image and try to build the project again.
Finally I got success to build km0_application project. (Not sure this is the correct way or not ?).

But try to do the same thing with km0_bootloader by copy file libbootloader_lp.a from GCC-RELEASE to EWARM-RELEASE and build. The result is build failed.

Regards,

Hi,

After more try with km4 project the same issue with km0 found.
Maybe…
lib_application_lp.a, libbootloader_lp.a lib_application_hp.a, libbootloader_hp.a were missing from IAR project release package.

Regards,

Hi @ruanjanc Please sync with github origin and try again, this bug has been fixed~

1 Like

Hi,
@ xidameng

Thank you for your support.
Now I was able to success build the IAR project both km0 and km4 project.

But, I’m facing new issue.

Issue1:
When connecting IAR J-Link and run, below message always print out to log console.

[Wed Jun 30 09:30:11.924 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:11.925 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:13.924 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:13.924 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:15.926 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:15.927 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:17.929 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:17.930 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:19.931 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:19.931 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:21.934 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:21.935 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:23.938 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:23.938 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:25.939 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:25.940 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:27.943 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:27.943 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:29.946 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:29.947 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:31.956 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:31.957 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f

Issue2:
Below Hard Fault Patch (Non-secure) ,message found on IAR project, when run my application. But this problem is not found in GCC project (same code are using).

[Wed Jun 30 09:27:41.513 2021] Hard Fault Patch (Non-secure)
[Wed Jun 30 09:27:41.513 2021] 
[Wed Jun 30 09:27:41.513 2021] Bus Fault: 
[Wed Jun 30 09:27:41.514 2021] Secure State: 0
[Wed Jun 30 09:27:41.514 2021] 
[Wed Jun 30 09:27:41.514 2021] Stacked: 
[Wed Jun 30 09:27:41.514 2021] R0 = 0x00000000
[Wed Jun 30 09:27:41.514 2021] R1 = 0x00000000
[Wed Jun 30 09:27:41.515 2021] R2 = 0x00010000
[Wed Jun 30 09:27:41.515 2021] R3 = 0x100238f0
[Wed Jun 30 09:27:41.515 2021] R12 = 0x10101010
[Wed Jun 30 09:27:41.515 2021] LR = 0x0e052c11
[Wed Jun 30 09:27:41.515 2021] PC = 0x0e052c10
[Wed Jun 30 09:27:41.516 2021] PSR = 0x61000000
[Wed Jun 30 09:27:41.516 2021] 
[Wed Jun 30 09:27:41.516 2021] Current: 
[Wed Jun 30 09:27:41.516 2021] EXC_RETURN = 0xffffffac
[Wed Jun 30 09:27:41.516 2021] MSP = 0x1002da00
[Wed Jun 30 09:27:41.517 2021] PSP = 0x1002da00
[Wed Jun 30 09:27:41.517 2021] xPSR = 0xa0000005
[Wed Jun 30 09:27:41.517 2021] CFSR  = 0x00000400
[Wed Jun 30 09:27:41.517 2021] HFSR  = 0x00000000
[Wed Jun 30 09:27:41.518 2021] DFSR  = 0x00000000
[Wed Jun 30 09:27:41.518 2021] MMFAR = 0x00000000
[Wed Jun 30 09:27:41.518 2021] BFAR  = 0x00000000
[Wed Jun 30 09:27:41.518 2021] AFSR  = 0x00000000
[Wed Jun 30 09:27:41.518 2021] PriMask = 0x00000000
[Wed Jun 30 09:27:41.519 2021] SVC priority: 0x00
[Wed Jun 30 09:27:41.519 2021] PendSVC priority: 0xe0
[Wed Jun 30 09:27:41.519 2021] Systick priority: 0xe0

Do you have any suggestion ?

Regard,

1 Like

Hi @ruanjanc I haven’t tried JLINK yet, but I have used the ImageTool to download the default firmware built with IAR, and it works fine, see pic below for my attempt,

1 Like

@xidameng

Thank you for your reply.

I will update my issue as below.

Issue1:
Below message is always print out in console log only when Debugging with IAR J-Link, but it no printout when download image via ImageTool and run in normal mode.

[Wed Jun 30 09:30:11.924 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:11.925 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:13.924 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:13.924 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:15.926 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:15.927 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:17.929 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:17.930 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:19.931 2021]  fw cmd fifo full 0
[Wed Jun 30 09:30:19.931 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Wed Jun 30 09:30:21.934 2021]  fw cmd fifo full 0

Is this printout message normal on platform when debug with J-Link ?

Issue2: (Close)
This issue is close now. My application is using cJSON lib, I forgot to initialize it.
The problem is solved after below code add before using cJSON lib.

cJSON_Hooks memoryHook;

memoryHook.malloc_fn = malloc;
memoryHook.free_fn = free;
cJSON_InitHooks(&memoryHook);

Regards,

Does your firmware worked as intended after downloading with JLINK?

@xidameng
Yes, it work as intended after downloading with JLINK.
The message just always printout during run the debugging mode with JLINK only.
I wonder is this normal on the platform ?

1 Like

That’s great

I will try with jlink and let you know later

1 Like

Hi @ruanjanc

Can you provide more context on the first issue? What is your application doing? does the messages appear when the JLink debugger halts and resumes the CPU?

It looks like the messages are an alert that some FIFO buffer is full, my first guess would be that the FIFO is used to process some data, but when the debugger halted the CPU, the data could not be processed and filled up the FIFO. But I will need more context on how and when the messages appear, to determine why the messages are appearing.

1 Like

@wyy
My application is read incoming data from tcp socket and forward to message queue for process with other message queue waiting task and also running interrupt timer to polling input switch.

It not happened print message out in normal running mode.

I will try to run pure SDK with J-link in debug mode and see the result.
if it not happened on pure SDK, then I will try to remove each part of my application and see the result gain.

Regards,

@ruanjanc

Yes, my suspicion is that if JLink is used to halt or pause the CPU in some way, the incoming data from TCP socket does not pause, which can result in the FIFO buffer filling up and outputting the message.

Are you using JLink to set any breakpoints / watchpoints?

1 Like

@wyy @xidameng

I will report my test result as below with pure SDK code use without any my application code add.

I did below step.
step1: unzip SDK and open km0 and km4 IAR project file.
step2: build km0_bootloader and build km0_application project.
step4: build km4_bootloader and build km4_application project.
step5: flash km0_boot_all.bin, km4_boot_all.bin and km0_km4_image2.bin to board with ImageTool.
step6: reset the board (there is no such message print at this step).
step7: Enter debug mode by Run Download and Debug km4_application with JLINK connected.
step8: press Go (same result with issue1 there is such message print at this step).
step9: press Break to halts the CPU (there is no such message print at this step).
step10: press Go (same result with issue1 there is such message print at this step).

below is part of log from step7

[Thu Jul 01 09:01:47.780 2021] [FlashErase] block_start:89000, block_size:1000
[Thu Jul 01 09:01:47.812 2021] [FlashErase] block_start:8a000, block_size:1000
[Thu Jul 01 09:01:47.876 2021] [FlashErase] block_start:8b000, block_size:1000
[Thu Jul 01 09:01:47.924 2021] [FlashErase] block_start:8c000, block_size:1000
[Thu Jul 01 09:01:47.972 2021] [FlashErase] block_start:8d000, block_size:1000
[Thu Jul 01 09:01:48.021 2021] [FlashErase] block_start:8e000, block_size:1000
[Thu Jul 01 09:01:48.068 2021] [FlashErase] block_start:8f000, block_size:1000
[Thu Jul 01 09:01:48.116 2021] [FlashErase] block_start:90000, block_size:1000
[Thu Jul 01 09:01:48.180 2021] [FlashErase] block_start:91000, block_size:1000
[Thu Jul 01 09:01:48.228 2021] [FlashErase] block_start:92000, block_size:1000
[Thu Jul 01 09:01:48.276 2021] [FlashErase] block_start:93000, block_size:1000
[Thu Jul 01 09:01:48.324 2021] [FlashErase] block_start:94000, block_size:1000
[Thu Jul 01 09:01:48.373 2021] [FlashErase] block_start:95000, block_size:1000
[Thu Jul 01 09:01:48.421 2021] [FlashErase] block_start:96000, block_size:1000
[Thu Jul 01 09:01:50.015 2021] [FlashWrite] block_start:7a000, offset_into_block:0, count:1d000
[Thu Jul 01 09:02:19.761 2021] #interface 0 is initialized
[Thu Jul 01 09:02:19.785 2021] interface 1 is initialized
[Thu Jul 01 09:02:19.785 2021] 
[Thu Jul 01 09:02:19.785 2021] Initializing WIFI ...FW Enable failed
[Thu Jul 01 09:02:20.072 2021] 
[Thu Jul 01 09:02:20.072 2021] RTL8721D[Driver]: set ssid [Rain.] 
[Thu Jul 01 09:02:20.152 2021] 
[Thu Jul 01 09:02:20.152 2021] RTL8721D[Driver]: rtw_set_wpa_ie[1160]: AuthKeyMgmt = 0x2 
[Thu Jul 01 09:02:20.176 2021] 
[Thu Jul 01 09:02:20.176 2021] RTL8721D[Driver]: rtw_restruct_sec_ie[4202]: no pmksa cached 
[Thu Jul 01 09:02:20.342 2021] 
[Thu Jul 01 09:02:20.342 2021] RTL8721D[Driver]: start auth to cc:64:a6:43:98:68
[Thu Jul 01 09:02:20.342 2021] 
[Thu Jul 01 09:02:20.342 2021] RTL8721D[Driver]: auth alg = 2
[Thu Jul 01 09:02:20.343 2021] 
[Thu Jul 01 09:02:20.343 2021] RTL8721D[Driver]: 
[Thu Jul 01 09:02:20.343 2021] OnAuthClient:algthm = 0, seq = 2, status = 0, sae_msg_len = 0
[Thu Jul 01 09:02:20.344 2021] 
[Thu Jul 01 09:02:20.344 2021] RTL8721D[Driver]: auth success, start assoc
[Thu Jul 01 09:02:20.344 2021] 
[Thu Jul 01 09:02:20.344 2021] RTL8721D[Driver]: association success(res=31)
[Thu Jul 01 09:02:20.345 2021] 
[Thu Jul 01 09:02:20.345 2021] RTL8721D[Driver]: ClientSendEAPOL[1600]: no use cache pmksa 
[Thu Jul 01 09:02:20.354 2021] [rtw coex warning]:event(9) with cur state(3)
[Thu Jul 01 09:02:20.436 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:20.436 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:20.459 2021] [rtw coex warning]:event(5) with cur state(5)
[Thu Jul 01 09:02:20.569 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:20.569 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:20.686 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:20.686 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:20.687 2021] wlan1: 1 DL RSVD page success! DLBcnCount:01, poll:00000001
[Thu Jul 01 09:02:20.814 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:20.814 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:20.815 2021] 
[Thu Jul 01 09:02:20.815 2021] RTL8721D[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)
[Thu Jul 01 09:02:20.816 2021] 
[Thu Jul 01 09:02:20.816 2021] RTL8721D[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[Thu Jul 01 09:02:21.322 2021] 
[Thu Jul 01 09:02:21.322 2021] Interface 0 IP address : 192.168.1.46
[Thu Jul 01 09:02:21.345 2021] WIFI initialized
[Thu Jul 01 09:02:21.345 2021] 
[Thu Jul 01 09:02:21.345 2021] init_thread(58), Available heap 0x24c20 fw cmd fifo full 0
[Thu Jul 01 09:02:22.247 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:22.343 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:22.343 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:24.255 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:24.255 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:24.351 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:24.352 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:25.463 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:25.464 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:25.812 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:25.813 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:26.245 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:26.245 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:28.267 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:28.267 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f
[Thu Jul 01 09:02:28.376 2021]  fw cmd fifo full 0
[Thu Jul 01 09:02:28.376 2021] MAC_1C0=00000002, MAC_1C4=00000000, MAC_1C8=00000000, MAC_1CC=0000000f

So, I can confirm that Issue1 is occur on pure SDK code.

Regards,

1 Like

@ruanjanc

step7: Enter debug mode by Run Download and Debug km4_application with JLINK connected.

I have managed to replicate the issue.
If you look at doc/AN0400 Application note chapter 6.3, in IAR you should download image using Project>Download>Download active application, and start debugging using Project>Debug without Downloading.

It is not recommended to use Project>Download and Debug, my guess is that this uses a different process that is not compatible.

1 Like

@wyy

I need to do with below step to eliminate such message print out.

step1: Project>Download>Download active application.
step2: Press reset button on the board to reset CPU.
step3: Project>Debug without Downloading

Without step2 the message will printout after press Go. May be after step1 finish CPU is still in Image flashing mode. So, we need to leave Image flashing mode by reset CPU first ?

regards,

Yes, during image upload, a special flashloader program needs to be uploaded to RAM to handle writing the image.
Probably after image upload, you need to reset the board to clear out the flashloader program before starting debug.

2 Likes