Flash problem on 1343 LPCXpresso board

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Flash problem on 1343 LPCXpresso board

1,399 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lmoreira on Fri May 11 05:57:51 MST 2012
Hi Guys,
I just bought a new LPC1343 board to replace the one i was using previously because it came up with an error when I tried to debug my program. The error I got was "flash not ready" error 5. Now I just got the same error with the new board...
I will try to get more detailed info, but was just wandering if you Guys have any ideas. I am powering the board from the PC's USB port and it happened since i implemented a systick that operates the Led on the board.

Best Regards
                    Luis
0 项奖励
回复
5 回复数

1,388 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lmoreira on Sun May 13 23:54:17 MST 2012
Hi Guys,
Thank you very much for the Help, I managed to recover my boards. Setting the Debug option "Vector catch" to True did it. I had an error on the way I called the tasks on my simple scheduler, and it caused it to try to get a fifth element from the array when the array only has four elements. I understand that this situation will cause an hardfault exception, which I came across before, but I am not quite sure why would it lock the part but I guess it depends on what I am actually getting or accessing on that fifth element.

if anyone is going to need to do this please remember to set the "Vector catch"  option back to false after you recovered the board, as per the manual. 

Once again Thank you very much.
Best Regards
                    Luis
0 项奖励
回复

1,388 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by SteveClevenger on Sat May 12 00:35:04 MST 2012
You may/may not have locked the part. You should be able to get the part to run the ISP, vs. vectoring to your flash image. The ISP provides a stable boot configuration for the part. There's several threads about using the ISP, and more information on the Code Red Wiki site. It's also documented in the LPC user's manual. The quickest thing to try is to set the "Vector catch" option to 'true' in your debug configuration. This drives the part through a reset during connection, and might cure the problem.
0 项奖励
回复

1,388 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Fri May 11 09:28:56 MST 2012
To get access to a 'locked' part:
http://support.code-red-tech.com/CodeRedWiki/DebugAccessChip
0 项奖励
回复

1,388 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lmoreira on Fri May 11 07:36:00 MST 2012
Hi deserve that :)...
This is the error I get when trying to debug:


Quote:

  15: Target error from Commit Flash write: Et: Flash driver not ready.

On both boards this error came after I implemented the LED routine, but I am also playing with an array of pointers to functions as I am investigating the implementation of a simple scheduler.
Is interesting to note that the programs that I was trying to debug on the boards were different.
On this board I got an HardFault exception when I tried to run the program, I assumed it was to do with the array of pointers. When I was trying to download the program again it came up with the error.

This is the code for the LED routines, although I think this is probably not the cause:


#include "LPC13xx.h"
#include "gpio.h"
#include "ledControl.h"


volatile uint32_t taskNumber = 0;
volatile uint32_t msTicks;                            /* counts timeTicks */
volatile uint32_t ledStatus;        /* Keeps track of led Status. */
volatile uint32_t delayLen = SHORT_DELAY_LEN;
volatile uint32_t ledHeartBeat = 0;
/*----------------------------------------------------------------------------
  SysTick_Handler
 *----------------------------------------------------------------------------*/
void SysTick_Handler(void)
{
    msTicks++;        /* increment counter necessary in Delay() */
    //swapTask();
}

void sysTickInit()
{
    if (SysTick_Config(SystemCoreClock / 1000)) /* Setup SysTick Timer for 1 msec interrupts  */
    {
        while (1);                                  /* Capture error */
    }

}


void ledInit()
{
    /* Enable AHB clock to the GPIO domain. */
    LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);

    GPIOSetDir( 0, 7, 1 );
    GPIOSetValue( LED_PORT, LED_BIT, LED_ON );
}


void ledControlA()
{
    switch(ledHeartBeat)
    {
    case 0:
        delayLen = MAIN_DELAY_LEN;
        break;
    default:
        delayLen = SHORT_DELAY_LEN;
        break;
    }

    if(msTicks >= delayLen)
    {
        if(ledStatus == LED_OFF)
        {
            // Turn LED on, then wait
            GPIOSetValue( LED_PORT, LED_BIT, LED_ON );
            ledStatus = LED_ON;
            delayLen = SHORT_DELAY_LEN;
        }

        else
        {
            // Turn LED off, then wait
            GPIOSetValue( LED_PORT, LED_BIT, LED_OFF );
            ledStatus = LED_OFF;

        }

        msTicks = 0;
        if(delayLen == SHORT_DELAY_LEN)
        {
            ledHeartBeat++;
        }

        if(ledHeartBeat == 4)
        {
            GPIOSetValue( LED_PORT, LED_BIT, LED_OFF );
            ledStatus = LED_OFF;
            ledHeartBeat = 0;
        }

    }
}
I then call ledControlA as a task on the Scheduler:

void createTasks()
{

    tasksList[0] = &checkForTxDataReady;
    tasksList[1] = &ledControlA;
    tasksList[2] = &checkForTxPacketReady;
    tasksList[3] = &checkForRxPacketReady;
    activeTask = 0;
}

void scheduler()
{
    tasksList[activeTask]();
    
    if(activeTask++ >= NUMBEROFTASKS)
    {
        activeTask = 0;
    }
}
Best Regards
                   Luis
0 项奖励
回复

1,388 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri May 11 06:18:02 MST 2012

Quote: lmoreira
... since i implemented a systick that operates the Led...



No Code, no idea :rolleyes:
0 项奖励
回复