Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists