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.

TMS320F28379D: Can't read CanbRegs in Code Composer

Part Number: TMS320F28379D


Tool/software:

Dear Tech Support,

 

I’m trying to set up the LAUNCHXL F28379D development board’s CANB peripheral on GPIO pins 12 (Tx) and 17 (Rx) using Code Composer 11.0.0.00012. Upgrading to a newer version is not an option due to compatibility with the customers development environment. I’m using only CPU1. The first code I wrote was:

 

#include "F2837xD_device.h"

#include "F2837xD_can.h"

 

int main(void)

{

    while(1);

    return 0;

}

 

It compiled without errors, but did warn of unreachable code since the wait command blocks the return command.

 

I looked at the CanbRegs through the onboard debugger. All values were 0x00000000, but the data sheet indicated some registers should not be 0x00000000. I then looked at the Memory Browser view. Starting at data address 0x0004A000, the data reported back was “----“, when I hovered the mouse over the first word of the data field. The following message also popped up, “Memory map prevented reading 0x0004A000@Data.” I searched the chat groups for a solution and tried adding the following line to the debugger’s *.gel file:

 

GEL_MapAddStr(0x0004A000,1, 0x0800, "R|W|AS4",0);                   /*   CANB    */

 

I recompiled, and all the “----” and “Memory map prevented…” went away. Unfortunately, all of CanbRegs registers in the Register view and Memory Browser view were still 0x00000000 instead of their default values.

 

As a sanity check, I programmed the Piccolo Control Card F28035 with the same while(1) command in main(), and was able to see the correct default values for the ECAN registers.

 

What do I need to do to see the correct default values of CanbRegs on the LAUNCHXL F28379D using Register view and Memory Browser view?

 

Thank you,

 

Mark Prosachik

  • Hi Mark,

    After power-up, all the peripherals on F2837x devices are disabled by default. They must be enabled in order to operate or response to register read and write.

    Please use the APIs below to enable the CANA and CANB in your main():

    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_CANA);
    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_CANB);

  • QJ,

    API's are not the solution, nor are we allowed to use them. I specifically ran the following program...

    int main()

    {

        while(1);

        return 0;

    }

    ...on both LAUNCHXL F28379D and Piccolo F2803x controlCARD to take CAN peripheral code out of the equation. The debugger doesn't care if there is CAN code or not. The debugger has visibility to all the registers.

    LAUNCHXL F28379D reported 0x00000000 for every register, but the data sheet indicates several registers are supposed to have non-zero default values.

    Piccolo F2803x controlCARD reported the correct default values.

    There is nothing different with the programs; therefore, the problem is in the development environment.

    This is a problem that requires deep knowledge of the development environment. Please find an expert to answer before responding.

    Below is the what the LAUNCHXL F28379D board reported.

    CAN_ES should have a default value of 0x00000007

    CAN_BTR should have a default value of 0x00002301

    CAN_RAM_INIT should have a default value of 0x00000005

    Below is the what the Piccolo F2803x controlCARD board reported.

    Values highlighted are correct non-zero, default values: 

  • The debugger doesn't care if there is CAN code or not.

    Yes. Code of CAN module init is not required, but the clock to the module should be enabled. The clocks to the peripherals are enabled through the PCLKCRx.