This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unable to configure PD7 as Force boot pin



Hi Friends,

I need to force boot loader with PD7 pin in one of my project,

Trying same experiment on EK-LM4F120XL launchpad

Note that I alrady emoved R15 (VBus SENSE) which is connected to PD7 to allow PD7 to work as GPIO,

unable  to make it.  please find below my code

    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0x01;
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;

    HWREG(GPIO_PORTD_BASE + GPIO_O_DIR) = 0x00;
    HWREG(GPIO_PORTD_BASE + GPIO_O_PUR) = 0xFF;
    HWREG(GPIO_PORTD_BASE + GPIO_O_DEN) = 0XFF;
    HWREG(GPIO_PORTD_BASE + GPIO_O_DATA) = 0x00;

also I tried

    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0x80;
    HWREG(GPIO_PORTD_BASE + GPIO_O_DEN) |= 0x80;
    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = 0;

    HWREG(GPIO_PORTD_BASE + GPIO_O_DIR) = 0X00;
    HWREG(GPIO_PORTD_BASE + GPIO_O_PUR) = 0x80;
    HWREG(GPIO_PORTD_BASE + GPIO_O_DATA) = 0x80;

Help me where I am doing wrong. Post

Regards

Paddy

  • Hi,

       Both your unlocking sequence has some faults. Refer to code snippet by cb1 from the post link below.

       TM4C123 NMI unlock

       As per cb1 advice, you need to enable the peripheral first, before the unlock sequence. Take note that the code snippet only sets PD7 as GPIO. To set PD7 as input, add these lines below before locking.

    GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_7);
    GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_7, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);

    -kel