The program size issue regarding the standby mode of amb82

Friends, have you encountered a compilation failure issue when merging standard standby mode into your own application code? My own application code takes up approximately 59% of the program’s storage space. When I compiled the routines for standard standby mode separately, I found that the standalone standard standby mode also takes up approximately 59%. I wonder if this is the reason for my compilation failure? Additionally, can the code for standard standby mode be optimized? I guess there is overlap and conflict between PowerMode. h and Wifi. h. Can we get everyone’s answer to this question? thanks

Hi @ren_yucheng,

Do you have any source code for me to produce the compilation issue? Or do you have the error logs that you can provide?

As shown in the figure, if I start the header file in standby mode, there will be a compilation error

Hi @ren_yucheng,

I tried including the header files and there’s no compilation errors at my side. I am using IDE 2.2.0.


I suspect it could have something to do with g++. You can try to back up your code and reinstall SDK again. Delete the “ameba_pro2_toolchain” and “ameba_pro2_tools” in tools folder and “4.0.6-build20231220” in hardware/AmebaPro2 folder.

Is it possible to copy the whole error log and your source code for me? I am unable to see the error at the back.

error log.zip (955 字节)
ObjectDetectionCallback2.zip (4.8 KB)
Thank you for your reply. Here are my source code and error logs. By the way, I have used my own trained model and can compile it without using standby mode header files

arm-none-eabi-g++: fatal error: cannot execute ‘c:/users/administrator/appdata/local/arduino15/packages/realtek/tools/ameba_pro2_toolchain/1.0.1-p1/bin/…/libexec/gcc/arm-none-eabi/10.3.0/cc1plus.exe’: CreateProcess: No such file or directory
compilation terminated.

Hi @ren_yucheng,

As I do not have PID_v1.h, I have commented out to include this file and its function to compile, and I am able to compile successfully at my side.

“CreateProcess: No such file or directory” error got something to do with the g++ compiler. I suggest that you remove the board and re-download the board using board manager to see if this error still occurs. Sometimes its because of an incomplete update, or you was attacked by some malware and some files got deleted. I think your code is fine.

Thank you for your reply. I tried reinstalling the entire Arduino IDE, but the issue was not resolved. It was normal to compile the standby mode routine separately, so I did a test. I spent some time adding different header files to the standby mode routine for testing. Then, I found that when all four header files appeared at the same time as shown in the figure, a compilation error occurred. However, removing any one or both can compile normally, And I have tried to add the four header files as shown in the figure to the Bluetooth configuration WIFI routine, and the result is the same. When all four files exist simultaneously, an error will be reported,
1

So sorry. Not sure why I couldn’t produce the error on my side.

This is my pass log.
pass log_1.zip (7.7 KB)
and this is the example that I compiled:
StandbyMode.zip (975 Bytes)

Can you try replacing the toolchain,
https://drive.google.com/drive/folders/1vGXQUcsmgWvMZdFAvFtlGrAAnrkrmqf8?usp=drive_link
and see if it works.

replace it in C:\Users\ {USERNAME}\AppData\Local\Arduino15\packages\realtek\tools

Maybe you can provide the full compilations log if it still fails.

Thank you again for your reply. I used the toolchain you provided to directly overwrite and replace the files in the path you described, and ran the standby mode file you provided using 2.2.1. The error log is as follows. I would like to ask if you are also using the Windows environment. After consulting some information, some friends have described that the problem needs to be solved by setting environment variables, Most of the g++issues that can be found occur during cross platform porting, where there are path or version issues with library dependencies. However, I don’t think this is a problem for me, Otherwise, it cannot be explained that compiling a header file separately is normal.
error-log.zip (30.5 KB)

1 Like

Yes, I am currently using Windows environment. May I know if you currently have any antivirus software enabled?

When compiling, it should be using the toolchains provided in the SDK, don’t think you have to include them in variable environment.

I have temporarily abandoned this issue. I think it may be resolved one day after the Arduino IDE version stabilizes, or a similar reproducible friend may appear again. Thank you for your reply