logo

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Taylor Bartlett  
#1 Posted : Monday, June 1, 2015 11:17:39 AM(UTC)
Taylor Bartlett

Rank: Newbie

Joined: 6/1/2015(UTC)
Posts: 4

Was thanked: 3 time(s) in 3 post(s)
Hello,

I am setting up the server SDK for an LPC 4088 developement kit.

I chose to go with LPCXpresso since it has the quickest way to get the proper libraries for this board (dev board library/chip library). I have created 4 seperate projects, the board library, the chip library, the Matrikon server SDK (v2.04), and the main project with freertos/lwip/main server code. When I link the files I get an error that I have exceeded the 512KB on the chip:

Code:
section `.text' will not fit in region `MFlash512'
section `.bss' will not fit in region `RamLoc64'


I made a mapfile to check what the culprit for this was and it looks like the SDK is taking up a LOT of space. I am compiling the libraries to static (.a) libraries and using the newlibnano headers with semihosting. Is there some way of making the SDK smaller? Should it not be its own project maybe?
Also, I get:

Code:
libmatrikon_opcua_server_sdk.a(opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.o): In function `z638bd936d0':
/internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.c:85: undefined reference to `z880f160278'


when I do not add -shared to my linker. It was my understanding that this will make the libraries dynamically linked which is not possible in ARM builds.

Let me know if more info is neccessary to help.

Edited by user Monday, June 1, 2015 3:48:01 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Taylor Bartlett for this useful post.
Offline Taylor Bartlett  
#2 Posted : Monday, June 1, 2015 2:56:46 PM(UTC)
Taylor Bartlett

Rank: Newbie

Joined: 6/1/2015(UTC)
Posts: 4

Was thanked: 3 time(s) in 3 post(s)
I got the SDK to fit in the flash by excluding the standard namespace and the ram by reducing the OPCUA_BUF_SIZE. I am still having issues with the linking though.
thanks 1 user thanked Taylor Bartlett for this useful post.
Offline Liam  
#3 Posted : Tuesday, June 2, 2015 12:55:32 AM(UTC)
Liam

Rank: Newbie

Joined: 12/1/2014(UTC)
Posts: 7

Was thanked: 2 time(s) in 2 post(s)
Hi Taylor,

The SDK itself takes up about 350kB on an ARM Cortex-M3 or M4 without the standard address space and subscriptions. It requires just over 512kB for the embedded profile including security and the full address space. These numbers are for GCC -O2.

For this reason we do not recommend deploying the SDK on an MCU with only 512kB Flash unless you have external flash that you can execute code from. We would recommend a 1MB Flash MCU (which are readily available from a variety of vendors) or in the case of NXP you can often execute from QSPI external Flash. QSPI flash chips are cheap, large and fast.

The reason the SDK takes up a lot of space is because it is a large and complex application.

Regarding your linker issues, please post more detailed information or contact support@matrikonopc.com.

Best regards,

Liam.
thanks 1 user thanked Liam for this useful post.
Offline Taylor Bartlett  
#4 Posted : Tuesday, June 2, 2015 12:39:39 PM(UTC)
Taylor Bartlett

Rank: Newbie

Joined: 6/1/2015(UTC)
Posts: 4

Was thanked: 3 time(s) in 3 post(s)
Thanks for the answer Liam! I think I'll put it on the QSPI on this board, thanks. Sure, I am using the GNU make builder instead of the CDT internal builder(arm-none-eabi v4.8.4). My linker command is below:

Code:
arm-none-eabi-c++ -nostdlib -L"/home/mfactor/dev/workspace/lpc_board_ea_devkit_4088/Debug" -L"/home/mfactor/dev/workspace/lpc_chip_40xx/Debug" -L"/home/mfactor/dev/workspace/matrikon_opcua_server_sdk/Debug" -Xlinker -Map="mBedded.map" -Xlinker --gc-sections -mcpu=cortex-m4 -mfpu=vfp -mfloat-abi=softfp -mthumb -T "mBedded_Debug.ld"


I am compiling the SDK into an static library in a different project and linking it in. During the compliation of the SDK there is an implicit declaration warning that

Code:
Building file: ../src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -D__NEWLIB__ -I"/home/mfactor/dev/workspace/matrikon_opcua_server_sdk/inc" -I"/home/mfactor/dev/workspace/matrikon_opcua_server_sdk/inc/API" -I"/home/mfactor/dev/workspace/matrikon_opcua_server_sdk/inc/API/security_interfaces" -I"/home/mfactor/dev/workspace/matrikon_opcua_server_sdk/src /internals" -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fPIC -mcpu=cortex-m4 -mfpu=vfp -mfloat-abi=softfp -mthumb -D__NEWLIB__ -specs=redlib.specs -MMD -MP -MF"src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.d" -MT"src\ /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.d" -o "src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.o" "../src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.c"
../src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.c: In function 'z638bd936d0':
../src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.c:80:9: warning: implicit declaration of function 'z880f160278' [-Wimplicit-function-declaration]
data = zc0d65c20ea(ze773fa3c39[ze892b9a8ab]) ^ (zb464b78c37 >> (zf2a195e63a - 8));
^
Finished building: ../src /internals/opcua_sdk_BED565559AC9C6FB65B23DE0DACA6EFCFA475997.c


I searched all of my files and was not able to see this defined anywhere. I made a different example with a simulator that used the same SDK without any issue. This used the regular gcc (v4.8.2) along with your makepp examples that came with the kit. There is no error or warning while using this toolchain. There is a possibility that I have one file in my main project that is from version 1.53(I think). This would most not likely cause this type of problem though...

It seems like a file is missing. execpt that this exact folder compiles with makepp(gcc,g++,ar). (Also sorry for all the copy paste I don't like doing that but the obfuscation makes it hard not to)
thanks 1 user thanked Taylor Bartlett for this useful post.
Offline Liam  
#5 Posted : Wednesday, June 3, 2015 3:01:31 AM(UTC)
Liam

Rank: Newbie

Joined: 12/1/2014(UTC)
Posts: 7

Was thanked: 2 time(s) in 2 post(s)
Hi Taylor,

I've sent you a private message as I need your licensee details in order to debug this for you.

Please reply to my PM with the required details. Please do not post licensee details to the public forum.

Best regards,

Liam.
thanks 1 user thanked Liam for this useful post.
Offline Christoph Obrecht  
#6 Posted : Friday, February 12, 2016 9:38:05 AM(UTC)
Christoph Obrecht

Rank: Newbie

Joined: 2/12/2016(UTC)
Posts: 1

Was thanked: 1 time(s) in 1 post(s)
I've also a question to the SDK memory size.

Which settings (macros, defines) have the biggest impact for the SDK flash memory requirements?

And what means, excluding the standard namespace?

thanks 1 user thanked Christoph Obrecht for this useful post.
Offline Basavaraju B V  
#7 Posted : Monday, February 15, 2016 3:49:58 AM(UTC)
Basavaraju B V

Rank: Advanced Member

Joined: 6/10/2015(UTC)
Posts: 34
Location: Bengaluru

Was thanked: 1 time(s) in 1 post(s)
Hi Christoph,

Please correct me if I am using wrong name.

The Macros which will impact the SDK flash memory requirements are:
+ UA_INCLUDE_SECURITY (It is based on the security library which will be used. For example for MbedTLS the memory will add around 30KB to 40KB extra)
+ UA_INCLUDE_STANDARD_ADDRESS_SPACE (If this is set to 1 then all supported type information will be present in the server. If it is set to 0, then around 100KB of memory can be reduced)

I hope my answer was helpful. Please let me know if more information is needed.

Regards,
Basavaraju B V
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Matrikon Subscribe  |   Matrikon Unsubscribe  |   Global Unsubscribe  |   Privacy Statement  |   Do Not Sell My Personal Information