Page 1 of 1

strlen builtin

Posted: Wed May 08, 2013 7:46 am
by Hildy
I'm having problems with strlen on an STM32F103; I had this working on LPC2148, but for some reason it crashes:

void
console_log (const char *c)
{
sdWrite (&SD1, (uint8_t *) c, strlen (c));
sdWrite (&SD1, (uint8_t *) "\n\r", 2);

}

on STM32, I had to write my own strlen; the builtin hangs hard.

Re: strlen builtin

Posted: Wed May 08, 2013 8:16 am
by Giovanni
Hi,

Could this be a toolchain/libraries problem? which compiler are you using?

Giovanni

Re: strlen builtin

Posted: Wed May 08, 2013 9:13 am
by Hildy
I'm using the paparazzi ppa gcc-4.6.2 from here:

http://paparazzi.enac.fr/wiki/Installation/Linux

they target stm32f1xx as their primary board.

this is the same compiler that I had working with lpc2148.

Re: strlen builtin

Posted: Wed May 08, 2013 9:34 am
by Giovanni
Could you try a different toolchain? for example this one: https://launchpad.net/gcc-arm-embedded

Giovanni