Assembler error!?! when using gcc to compile project


I just got a strange error message when I built the project for target in Visual Studio:

... Compiling gprs.c
/cygdrive/f/DOKUME~1/marx/LOKALE~1/Temp/ccbMYyOf.s: Assembler messages:
/cygdrive/f/DOKUME~1/marx/LOKALE~1/Temp/ccbMYyOf.s:1757: Error: byte or halfword not valid for base register -- `strb r3,[sp]'
make: *** [gprs.o] Fehler 1

I don’t know how to look for the error since the assembler file is deleted after the build run - and of course I don’t get an error when I build the RTE version…

Any ideas appreciated…



Hi again,

Well, I found the code that causes the problem by deactivating sections of the code in the file… It took me like 20 compile runs to isolate these lines:

for ( j=0; (i < wm_strlen(str)) && (j < 3) && (str[i] != ','); j++,i++ )
    tmp_cmd[j] = str[i];

If these are in the file, the error happens - if they are out => no problem!

I don’t see anything bad in this code. It should be perfectly OK…

By the way, these are the variable definitions:

bool gprs_set_Form( u8 nr, ascii *str )
   u16 i,j;
   ascii tmp_field[21],tmp_cmd[4];

Strange, isn’t it???


Hi yet again,

It looks like “i” is not initilized… but the code fragment actually is surrounded by an outer loop which initilizes “i”…


Hello [color=blue]jan

You have not initialized the variable “u16 i” before you use it… but that might be done in code you choose not to show us…

Have you tried to compile with ARM ADS compiler?


Ok sorry…

Works like a charm!!!