Out of xmem code space with a BL4S200

I have a problem with the XMEM memory like a precedent post of 2016 but it’s little different.

Before i used a BL2665 and i don’t have problem after change the DATA_ORG
The map is:
//Segment Origin Size
Root Code 00:0000 003dbd
Root Data 10:bdff 006168
Xmem Code 0e:e000 040b14

Noow i want to load the program on a BL4S200 and i have the message:
line 2161 : ERROR STDIO.C : Out of xmem code space. Please refer to the Dynamic C User’s Manual for more information.

The map is :
//Segment Origin Size
Root Code 0000:0000 003674
Root Data 0010:9620 0021df
Xmem Code 0000:e756 0518a4

I load the program in Flash and i use the Enable separate instruction and date option.

The product BL2665 and BL4S200 have the same memory but in the stdbios of the DC10.72D i dont know for mofify the DATA_ORG

For the answer of “petermcs”
I don’t understand where adjust the XMEMCODE_SIZE macro which you can define in the Project Options\defines tab, e.g. XMEMCODE_SIZE=0x60000

Thanck you for the answer.

For the answer of “petermcs”
I don’t understand where adjust the XMEMCODE_SIZE macro which you can define in the Project Options\defines tab, e.g. XMEMCODE_SIZE=0x60000,

When you open the Rabbit Gui you will see at the top the menu options;
Select OPTIONS, then select PROJECT OPTIONS, you will see several tabs like COMMUNICATIONS, COMPILER, DEBUGGER and DEFINES;
Select DEFINES in that window right where it says Global Macro Definitions: Please add XMEMCODE_SIZE=0x60000
See screenshot https://ibb.co/bvzBFnw


Thanck you for the helping but i try but it not resolve the problem.

I have the same message and the map file is:
Root Code 0000:0000 003587
Root Data 0010:962c 0021d3
Xmem Code 0000:e756 0518a4

The message is :
line 2161 : ERROR STDIO.C : Out of xmem code space. Please refer to the Dynamic C User’s Manual for more information.

I don’t understand because this program works with a BL2665 where i have modify the DATAORG in stdbios.c

I suppose the library of the BL4S200 are more big.

I look the stdbios.c in the library of the 10.72D and i don’t know for mofify the DATAORG

Thanck you for the answer

That’s a large jump in the XMEM code usage. What features are you enabling in your program? Why did ROOT DATA go down by 16KB? Looking at that map, tou could have more code compiled to “root code”. Do you have lots of functions specifically flagged as “xmem”? If you remove the “xmem” flag, the compiler can locate them in “root code”.

Can you disable some features of your program to see how close it is to fitting in the given memory space?

Thanck you for the answer.

I use this code ; #memmap xmem

The library used are : fat16.lib

With the BL2665 board , after modification of the DATA ORG in the stdbios.c i have no problem.

Where modify the DATA ORG with Dynamic C 10.72D?

The next week end i disable somes features of the programm for identify the problem.

Thanck you

Complement of information.

I try to disable some features but i have the same problem ;
The error is : line 4227 : ERROR RWEB_GENERIC.LIB : Out of xmem code space.

My configurtaion is the same what i use with the BL2265 and it is that:

#define TCPCONFIG 0
#define USE_ETHERNET 1
#define HTTP_PORT 8084
#define USE_ZHTML 1

#define HTTP_MAXBUFFER 2048

#define SSPEC_MAXNAME 48



#memmap xmem
#use “fat16.lib”
#use “BLxS2xx.lib”
#use “dcrtcp.lib”
#use “http.lib”

Thanck you for the answer

Try removing the “#memmap xmem” statement so the compiler will attempt to place more code in root. Maybe even try “#memmap root” to see if that makes a difference.

I try but it don’t work.
I have four parts in the program and i active only two
I reinstall the software 10.72D and now it’s work with only 2 parts and without debug.
Thanck you for the answer.
I have add some information below with the differents lib and define.
What do you thing about?

Try reducing MAX_TCP_SOCKET_BUFFERS (cut in half) to see if that helps. You should be aiming for getting your code to build so you can look at the .map file to see how much space things are taking up, so you can make adjustments as necessary. It’s likely you have a “far” array that’s taking up a large chunk of XMEM.

Thanck you for the answer but nothing resolve my problem.
I try to reduce my code and i have delete the part with UserBlocks. One solution is reduce the size for the UserBlocks and in the file stdbios.c i read : “To facilitate development of multiple applications, a custom value for this macro may be added into Dynamic C’s Project Options’ Defines box.”
I read in one old mail it’snecessary to write the IDBlocks in the RC4310.
It’s true ?
Can you confirm if there is a solution for reduce the size of Userblocks ?
Thnanck you for the reply.

I risolve the modification of the size of UserBlocks with MAX_USERBLOCKS_SIZE=0x4000 but i have a strange result when i print the variables :
L4247 AR depart valide 0 (null)
L4248 AR depart heure 0 (null)
L4249 AR depart minute 0 (null)
L4250 AR depart valide 1 (null)
L4251 AR depart heure 1 (null)
L4252 AR depart minute 1 (null)
L4255 AR zones etat ynamicC Universal Rabbit BIOS Version 10.70ý{ÿb
L4256 AR zones duree icC Universal Rabbit BIOS Version 10.70ý{ÿb

it’s a problem with the memory of the RCM4310 or i have not enought space for the variables.
Thancks for the answer.

Yes, it is possible to change MAX_USERBLOCK_SIZE (note there isn’t an ‘S’ at the end of ‘USERBLOCK’) to get a larger area for your firmware, but you also need to write an updated System ID Block with a matching value. Look for the appropriate program in Utilities/Write_ID.

You might want to consider opening a support ticket with Digi International and having them help you troubleshoot this, possibly as part of their paid support. If you’re willing to provide a copy of your code, they can help with getting it to compile and identify possible bugs in your code that are contributing to problems.

In the code above, your (null) indicates you’re passing a null pointer to the printf() call, and the lower code looks like you’re pointing into the BIOS, somewhere in the first 4KB to 8KB of the program.