Topic : RC51 - "SIZEBUFPRINTF" option

Forum : 8051

Original Post
Post Information Post
August 1, 2007 - 3:29pm
Guest

Hi,

I want to enlarge the "printf" stack buffer size as explained 6.2.5.1 of RC51.pdf document.

My command line is as followed:
[...]
set RIDE_Path=c:\ride
set RIDE_BIN=%RIDE_Path%\bin
set OUTPUT_PATH=D:\work\EclipseworkspaceCeres\Ceres\Raisonnance\Embedded
set RIDE_INC=%RIDE_Path%\Inc;%RIDE_Path%\Inc\51;%RIDE_Path%\Inc\51\DOLPHIN;%SRC_BASIC%;%SRC_BREEZE%;%SRC_SHIFTREG%
set COMPIL_FLAG_IHM=CD SB OE(1) EXTSTK HUGE FP(NOFLOAT) PW(80) DF(EMBEDDED=1,RAISONANCE_RW_MACRO=1,FPGA_TEST_SPI=1) LARGE OE defnp=SIZEBUFPRINTF/60
set COMPIL_FLAG_TEST=CD SB OE(1) EXTSTK HUGE FP(NOFLOAT) PW(80) DF(EMBEDDED=1,RAISONANCE_RW_MACRO=1,FPGA_TEST_SPI=1) HUGE OE defnp=SIZEBUFPRINTF/60

set COMPIL_FLAG=CD SB OE(1) EXTSTK HUGE FP(NOFLOAT) PW(80) DF(EMBEDDED=1,RAISONANCE_RW_MACRO=1,FPGA_TEST_SPI=1)

rem
rem ******************
rem * Prepare compil *
rem ******************
rem

rem set directory
cd %OUTPUT_PATH%
mkdir Lst

rem goto link
rem
rem ************************
rem * Assemble and Compile *
rem ************************
rem

rem IHM/BASIC
%ride_bin%\RC51.EXE %SRC_BASIC%\CERESIHM.C OBJECT(%SRC_BASIC%\CERESIHM.OBJ) PIN(%RIDE_INC%) NOAM PR(%SRC_BASIC%\CERESIHM.LST) %COMPIL_FLAG_IHM%
if ERRORLEVEL = 1 pause

[...]

RC51 does not want to take that option (->fatal error: unknown control action:(null)...).

Would someone suggest something?

Thanks!

Regards.

Remo

Replies
Post Information Post
+1
0
-1
August 1, 2007 - 5:10pm
Guest

Hi Remo,

it seems there is a syntax error in the documentation.

Can you please try the following instead:

set COMPIL_FLAG_IHM=CD SB [...] defnp(SIZEBUFPRINTF=60) and tell us if it works better?

regards,
Lionel

+1
0
-1
August 1, 2007 - 6:20pm
Guest

Thanks Lionel,

It fixes the compile stage. But during link stage I am facing another issue:

*** ERROR 104 : MULTIPLE PUBLIC DEFINITIONS
SYMBOL : SIZEBUFPRINTF (CERESKERNEL)

I have double-checked and I have used this option to compile only one file. Where does it come from?

Regards,

Remo

Below the incriminated file:
[code]#include
#include
#include "CeresKernel.h"
#include "DefineAdrCtrlObsSimu.h"

extern int16 iLevelAffMsg;

/* -----------------------------------------------------------------------------
AffMsg. idem printf avec comme premier argument le niveau d'information
du message (ERROR, WARNING, INFO, DEBUG)
Masque toutes les It durant l'affichage en cas de test de it
----------------------------------------------------------------------------- */
void AffMsg(int16 iLevel, const char * sFormat, ...)
{
if (iLevel >= iLevelAffMsg)
{
va_list pArg;
va_start(pArg, sFormat);
if (iLevel == LOW) printf("Low: ");
else if (iLevel == DEBUG) printf("Debug: ");
else if (iLevel == INFO) printf("Info: ");
else if (iLevel == INFOH) printf("Infoh: ");
else if (iLevel == WARNING) printf("Warning: ");
else if (iLevel == ERROR) printf("Error: ");
vprintf(sFormat, pArg);
#ifndef EMBEDDED
FlushOutputStream();
#endif
va_end(pArg);
}
}

/* -----------------------------------------------------------------------------
AffMsg. idem AffMsg avec comme premier argument le numero de la carte
utile en test multi carte.
Masque toutes les It durant l'affichage en cas de test de it
----------------------------------------------------------------------------- */
void AffMsgMultiBoard(byte iBoardNum, int16 iLevel, const char * sFormat, ...)
{
if (iLevel >= iLevelAffMsg)
{
va_list pArg;
va_start(pArg, sFormat);
if (iLevel == LOW) printf("%d Low: ", iBoardNum);
else if (iLevel == DEBUG) printf("%d Debug: ", iBoardNum);
else if (iLevel == INFO) printf("%d Info: ", iBoardNum);
else if (iLevel == INFOH) printf("%d Infoh: ", iBoardNum);
else if (iLevel == WARNING) printf("%d Warning: ", iBoardNum);
else if (iLevel == ERROR) printf("%d Error: ", iBoardNum);
vprintf(sFormat, pArg);
#ifndef EMBEDDED
FlushOutputStream();
#endif
va_end(pArg);
}
}

/* ------------------------------------ */
/* fonctions d'arret suite a une erreur */
/* ------------------------------------ */
#ifdef EMBEDDED
void Error(void)
{
while(1) {
#ifndef __GNUC__
_nop_();
#endif
}
#ifndef __GNUC__
_nop_();
#endif
}
#endif

/* ------------------------------------ */
/* fonction basic d attente */
/* ------------------------------------ */
#ifdef EMBEDDED
void Tempo(dword dwT)
{
dword i;
for (i=0;i

+1
0
-1
September 6, 2007 - 9:53am
Guest

Hello,

Finally this option is not really useful for my application cause a I use the huge external stack. So the printsizebuffer is stuck at 50.

I am still facing an issue around my AffMsg function (in previous post). When vprintf function is called my putchar function runs in loop:

while (!(ASCON & pUart_ASCON_BitTransmitInterruptFlag));

It seems it does not see the end of the line. So after displaying what I want, I loose control.
It happens only when I want to display %d, %h ...

I notice also that when I let the linker without any constraints on xdata area it works fine but when I define a user area (to address a external ram), from 0x0000 to 0x4000 and put xdata above 0x4000 I face the issue.
Look at my linker options: XSIZE(32767) CSIZE(64000) RS(256) RSI(256) IX MAP XD(16384)

Does someone have any suggestion to help me to find out.

Thanks by advance. ;-)