SD1 stupid problem

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
fastlink30
Posts: 42
Joined: Tue Aug 12, 2014 1:25 pm

SD1 stupid problem

Post by fastlink30 »

i've a simple stupid problem, i can't send datas over serial (SD1)
on my custom board with stm32f103re, chibios 2.6.7

Code: Select all

    halInit();
    chSysInit();

    palSetPadMode(GPIOB, 6, PAL_MODE_STM32_ALTERNATE_PUSHPULL); // tx
    palSetPadMode(GPIOB, 7, PAL_MODE_INPUT); //rx
    sdStart(&SD1, NULL);

    shellInit();

....
    while (TRUE)
    {
        if (!shelltp_ser)
        {
            shelltp_ser = shellCreate(&shell_cfg_serial, SHELL_WA_SIZE, NORMALPRIO);
            LED2_ON;
        }
        else if (chThdTerminated(shelltp_ser))
        {
            shelltp_ser = NULL;           /* Triggers spawning of a new shell.   */
            LED2_OFF;
        }
sdWrite(&SD1,  (uint8_t *)"prova\r\n", 7);


no signal, if i try to toggle pins (changing SetpadMode configuration), is all ok
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SD1 stupid problem

Post by Giovanni »

Those pins can be used with USART1 only using remapping, see the RM. I remember there are also errata regarding remapping so also read that document.

Giovanni
fastlink30
Posts: 42
Joined: Tue Aug 12, 2014 1:25 pm

Re: SD1 stupid problem

Post by fastlink30 »

is not the correct way to remap how i do?

errata talk about pa12, not my case

can't use PAL_MODE_ALTERNATE() with stm32f103re, right?

when book about chibios is supposed to be ready?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SD1 stupid problem

Post by Giovanni »

Hi,

Remapping is not handled by the PAL driver, it is done by writing into the AFIO_MAPR, you can do that in boardInit() in your board files.

The book will be ready sometime after the official 3.0 release.

Giovanni
fastlink30
Posts: 42
Joined: Tue Aug 12, 2014 1:25 pm

Re: SD1 stupid problem

Post by fastlink30 »

thank you Giovanni,

on Boardinit() i put
AFIO->MAPR |= 4;

now is functional :)
Post Reply