Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

STR912 SPI port

Posted by ricardo marinheiro on August 22, 2008
hi everyone

Does anyone already put SPI port of str912 working over FreeRTOS?
I'm getting a crash when i try to use 91x_ssp libraries from ST.

Every hint are wellcome

Thank to all

RE: STR912 SPI port

Posted by damien h on August 28, 2008
Hi,

Yes, i m using the SPI port under FreeRTOS, to access to a SD card, through EFSL lib, no problem, it's working


Here, my init code, if can help you :
Regards.

Damien.



---------------------------------------------------------------
#define PULS_SD_CARD_SSP_PORTSSP0
#define PULS_SD_CARD_SPEED_INIT_KBITPERSEC380

u8 HAL_InitialiseSPP(void)
{
u8 SSP_ClockRate = 0;
u8 SSP_ClockPrescaler= 0;
SSP_InitTypeDef InitSSP;


/* disable the CS of the SD Card (should be already the case, but to be sure) */
HAL_DisableSDCardChipSelect ();


/* Add clock on SSP port */
if (PULS_SD_CARD_SSP_PORT == SSP0)
{
SCU_APBPeriphClockConfig (__SSP0, ENABLE);
}
if (PULS_SD_CARD_SSP_PORT == SSP1)
{
SCU_APBPeriphClockConfig (__SSP1, ENABLE);
}


/* reset the SSP port */
SSP_StructInit (&InitSSP);
SSP_DeInit (PULS_SD_CARD_SSP_PORT);


/* Configure the port */
InitSSP.SSP_FrameFormat = SSP_FrameFormat_Motorola;
InitSSP.SSP_Mode= SSP_Mode_Master;
InitSSP.SSP_CPOL= SSP_CPOL_Low;
InitSSP.SSP_CPHA= SSP_CPHA_1Edge;
InitSSP.SSP_DataSize= SSP_DataSize_8b;
InitSSP.SSP_SlaveOutput= SSP_SlaveOutput_Disable;
InitSSP.SSP_ClockRate= SSP_ClockRate;
InitSSP.SSP_ClockPrescaler= SSP_ClockPrescaler;

HAL_SetSSPClockSpeed (PULS_SD_CARD_SPEED_INIT_KBITPERSEC);


/* Init and enable the SSP port */
SSP_Init (PULS_SD_CARD_SSP_PORT,&InitSSP);
SSP_Cmd (PULS_SD_CARD_SSP_PORT,ENABLE);

return (0);
}


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner