This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX with External SDRAM LPC1788 - causes bus fault

Hello,

I'm using the Embedded Artists LPC1788 development kit and I'm trying to get a very simple RTX application running using the external SDRAM.

Here is what I have so far:

1) A simple RTX application that runs (blinks an LED) with no problem when I use the internal RAM. This same application crashes with a bus fault in "os_sys_init" when I us the external SDRAM.

2) I configure and initialize the external SDRAM before the call to __main (this is working as I can run the same blinking LED using the SDRAM with no RTX.

3) Even if I let me STACK and HEAP remain in the internal RAM but have variables etc.. in the SDRAM I get the bus fault.

4) The bus fault is an IMPRECISERR: Imprecise data bus error

The call stack looks like this when the fault occurs:

HardFault_Handler -> rt_put_rdy_first() -> rt_dispatch() -> rt_task_create() -> SVC_Hanlder...

Does anyone have any suggestions? I see no reason why this should cause a fault.

Thanks.

MAC

Parents
  • Hello,

    Thanks for your reply.

    Yes this initialization of the SDRAM works fine when RTX is not involved.

    I don't do an exhaustive test of the SDRAM because I've already tested it quite a bit without RTX.

    but just to satisfy myself my main does a little test as follows and always passes:

    int main (void)
    {
        volatile uint32_t *wr_ptr;
        uint32_t data;
        uint32_t i;
    
        PINSEL_ConfigPin(LED_PORT, RED_LED_PIN, 0);
        PINSEL_ConfigPin(LED_PORT, GRN_LED_PIN, 0);
        GPIO_SetDir(LED_PORT, RED_LED_PIN_MASK, GPIO_DIRECTION_OUTPUT);
        GPIO_SetDir(LED_PORT, GRN_LED_PIN_MASK, GPIO_DIRECTION_OUTPUT);
    
    
        wr_ptr = (uint32_t *)0xA0000000;
        for (i = 0; i < 0x100; i++)
        {
            *wr_ptr++ = 0x12345678;
            //*wr_ptr++ = i;
        }
    
        /* Verifying */
        wr_ptr = (uint32_t *)0xA0000000;
        for (i = 0; i < 0x100; i++)
        {
            data = *wr_ptr;
            //if (data != i)
            if (data != 0x12345678)
            {
                while(1);
            }
            wr_ptr++;
        }
    
        os_sys_init(init);                        /* Initialize RTX and start init */
    
        while ( 1 );
    }
    

    Any other ideas suggestions would be most appreciated.

    Mac

Reply
  • Hello,

    Thanks for your reply.

    Yes this initialization of the SDRAM works fine when RTX is not involved.

    I don't do an exhaustive test of the SDRAM because I've already tested it quite a bit without RTX.

    but just to satisfy myself my main does a little test as follows and always passes:

    int main (void)
    {
        volatile uint32_t *wr_ptr;
        uint32_t data;
        uint32_t i;
    
        PINSEL_ConfigPin(LED_PORT, RED_LED_PIN, 0);
        PINSEL_ConfigPin(LED_PORT, GRN_LED_PIN, 0);
        GPIO_SetDir(LED_PORT, RED_LED_PIN_MASK, GPIO_DIRECTION_OUTPUT);
        GPIO_SetDir(LED_PORT, GRN_LED_PIN_MASK, GPIO_DIRECTION_OUTPUT);
    
    
        wr_ptr = (uint32_t *)0xA0000000;
        for (i = 0; i < 0x100; i++)
        {
            *wr_ptr++ = 0x12345678;
            //*wr_ptr++ = i;
        }
    
        /* Verifying */
        wr_ptr = (uint32_t *)0xA0000000;
        for (i = 0; i < 0x100; i++)
        {
            data = *wr_ptr;
            //if (data != i)
            if (data != 0x12345678)
            {
                while(1);
            }
            wr_ptr++;
        }
    
        os_sys_init(init);                        /* Initialize RTX and start init */
    
        while ( 1 );
    }
    

    Any other ideas suggestions would be most appreciated.

    Mac

Children