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.

TMS570LC4357: Unble to compile basic DCAN_TX code.

Part Number: TMS570LC4357

I made a simple CAN_TX code where I am transmitting "HERCULES" through CAN4 through message box 1, but I am unable to compile my code and having the following errors:

Description    Resource    Path    Location    Type
gmake: Target 'all' not remade because of errors.    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_system.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_vim.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_startup.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_pmm.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_phantom.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_pcr.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_main.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_sys_dma.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_pinmux.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_notification.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_nmpu.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_esm.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_errata.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_epc.obj] Error 1    DCAN_TX             C/C++ Problem
gmake: *** [source/HL_can.obj] Error 1    DCAN_TX             C/C++ Problem
#66 expected a ";"    .ccsproject    /DCAN_TX    line 49, external location: C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include\_lock.h    C/C++ Problem
#66 expected a ";"    .ccsproject    /DCAN_TX    line 50, external location: C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include\_lock.h    C/C++ Problem
#262-D explicit type is missing ("int" assumed)    .ccsproject    /DCAN_TX    line 49, external location: C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include\_lock.h    C/C++ Problem
#262-D explicit type is missing ("int" assumed)    .ccsproject    /DCAN_TX    line 50, external location: C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include\_lock.h    C/C++ Problem
#112-D statement is unreachable    HL_sys_main.c    /DCAN_TX/source    line 81    C/C++ Problem


and the following is my main code:

/* USER CODE BEGIN (0) */
/* USER CODE END */

/* Include Files */

#include "HL_sys_common.h"

/* USER CODE BEGIN (1) */
#include "HL_can.h"
/* USER CODE END */

/** @fn void main(void)
*   @brief Application main function
*   @note This function is empty by default.
*
*   This function is called after startup.
*   The user can use this function to implement the application.
*/

/* USER CODE BEGIN (2) */
#define D_SIZE 9

uint8_t tx_data[D_SIZE] = {'H','E','R','C','U','L','E','S','\0'};

uint32_t checkPackets(uint8_t *src_packet, uint8_t *dst_packet, uint32_t psize);
/* USER CODE END */

int main(void)
{
/* USER CODE BEGIN (3) */
	canInit();
	canTransmit(canREG4, canMESSAGE_BOX1, tx_data);
	while(1);
/* USER CODE END */

    return 0;
}


/* USER CODE BEGIN (4) */
uint32_t checkPackets(uint8_t *src_packet, uint8_t *dst_packet, uint32_t psize){
	uint32_t err=0;
	uint32_t cnt=psize;
	while(cnt--){
		if((*src_packet++) != (*dst_packet++))
			err++;
	}
	return (err);
}

void canMessageNotification(canBASE_t *node, uint32_t messageBox)
{
	return;
}

void canErrorNotification(canBASE_t *node, uint32_t notification)
{
	return;
}

void esmGroup1Notification(unsigned channel)
{
	return;
}

void esmGroup2Notification(unsigned channel)
{
	return;
}
/* USER CODE END */

  • Also If required I have attached my project file:0830.DCAN_TX.7z

  • Yash,

    That error message is indicative of a syntax error. The actual 'mistake' might be in the line(s) preceding the one where missing ';' is reported.

    I don't 'see' the error looking at the code you pasted. I'd be looking for a missing ';' obviously but also some mistake in mismatched {} or () or ',' an extra token in some statement .. that sort of problem.

    You'll find this quickest using the help in the IDE... pay attention to syntax highlighting.

    You can also try commenting out lines of code and recompiling till the error disappears. Then start uncommenting till it comes back. Sometimes this helps if you are 'stuck' and can't just 'see' the error any other way and you can do as sort of binary search this way by commenting/uncommenting smaller sections of code until you home in on the bad lines.
  • Hello Anthony,

    I commented the entire code, essentially making the code equivalent to

    int main (void){
    
    }

    and still got the same errors mentioned above>

    NOTE: The error is directing me to _lock.h file which is a system library which is available in the directory: C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include

    I included the directory in my compiler include options in the first place because if not included compiler showed an error stating it could not find stdint.h

    I tried making few changes to the _lock.h but couldn't solve anything. I think that there is a problem not in the syntax of the library but the way it is being compiled.

    I request you to try compiling the project I had included above (note: please include the respective directory for stdint.h and stdbool.h in the compiler include options)

  • The error messages are coming from the C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include\_lock.h file which is part of the run time library for the arp32 compiler used for the EVE (Embedded Vision Engine) devices, whereas for a TMS570LC4357 device the include files for the ARM compiler should be used.

    Looking at the project properties for DCAN_TX project shows that in the Include path "C:\ti\ccsv6\tools\compiler\arp32_1.0.8\include" has been specified. Not sure how that happened, but try replacing with the standard "${CG_TOOL_ROOT}/include" include path so that the ARM compiler include directory is used.

    With that change I was able to get the project to compile.

  • Thank you, Chester,
    That solved my problem.