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


Machine Check execption PPC405 Xilinx

Posted by Charles on February 17, 2009

I did not realise that you can run the software simulator through the hardware debugger. I can download code and single step looking at registers and variables.

The start of the loop in mem_alloc() line 262 causes a machine check exception. The line that causes this instruction lwz r5, -32408(r13) but r13 is not initialised (0xa5a5a5a5).

Standalone version r13 = 0x43728

Found that the pointer to the short data area (r13) and the pointer to the second small data area (r2) are
not initialised in pxPortInitialiseStack() in port.c (as in xil_crt0.s)

I have now added this into source/portable/GCC/PPC405_Xilinx/port.c

I've added:

extern const unsigned _SDA_BASE_;
extern const unsigned _SDA2_BASE_;

* Initialise the stack of a task to look exactly as if the task had been
* interrupted.
* See the header file portable.h.
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
/* Place a known value at the bottom of the stack for debugging. */
*pxTopOfStack = 0xDEADBEEF;

/* EABI stack frame. */
pxTopOfStack -= 20;/* Previous backchain and LR, R31 to R4 inclusive. */

/* Parameters in R13. */
*pxTopOfStack = ( portSTACK_TYPE ) &_SDA_BASE_; /* address of the first small data area */
pxTopOfStack -= 10;

/* Parameters in R3. */
*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;

/* Parameters in R2. */
*pxTopOfStack = ( portSTACK_TYPE ) &_SDA2_BASE_;/* address of the second small data area */

/* R1 is the stack pointer so is omitted. */

*pxTopOfStack = 0x10000001UL;;/* R0. */
*pxTopOfStack = 0x00000000UL;/* USPRG0. */
*pxTopOfStack = 0x00000000UL;/* CR. */
*pxTopOfStack = 0x00000000UL;/* XER. */
*pxTopOfStack = 0x00000000UL;/* CTR. */
*pxTopOfStack = ( portSTACK_TYPE ) vPortEndScheduler;/* LR. */
*pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* SRR0. */
*pxTopOfStack = portINITIAL_MSR;/* SRR1. */
*pxTopOfStack = ( portSTACK_TYPE ) vPortEndScheduler;/* Next LR. */
*pxTopOfStack = 0x00000000UL;/* Backchain. */

return pxTopOfStack;

RE: Machine Check execption PPC405 Xilinx

Posted by Dave on February 17, 2009
And that fixes the problem? Thanks for reporting this, can you add a bug to the SourceForge bug list. Thanks.

[ 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