Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
MTG
Level 2
Level 2
5 questions asked 25 sign-ins 10 replies posted

Hello Madam/Sir,

I want to use can communication with Erika-v3 OS for TC397 tft board. I wrote can communication codes. I tried codes with Erika-v2 and Aurix development studio. Everthing works fine. But I tried codes with Erika-v3, I encountered the error as in the picture. The code gets stuck in the while loop that I marked in the IfxCan_Node_enableConfigurationChange  function. Maybe I forgot to modified conf.oil file at Erika-v3. Could you help me please, how I solve this problem?

 

0 Likes
7 Replies
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Dear MTG,

You could simplify the code and debug. Firstly, you can use the basic CAN demo code to debug from scratch. Below is fyi which is run under ADS platform.

 

 

#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "MCMCAN.h"

IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;

void core0_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
     * Enable the watchdogs and service them periodically if it is required
     */
    IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
    IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
    
    /* Wait for CPU sync event */
    IfxCpu_emitEvent(&g_cpuSyncEvent);
    IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
    
    /* Application code: initialization of MCMCAN module, LEDs and the transmission of the CAN message */
    initMcmcan();
    initLeds();
    transmitCanMessage();

    while(1)
    {
    }
}

 

 

0 Likes
MTG
Level 2
Level 2
5 questions asked 25 sign-ins 10 replies posted

Hi dw,

Yes I used this example code, it works very well at ADS platform.

But I want to use this code with Erika-v3 OS at Eclipce. I implemented this example code at Erika-v3 OS.

It didn't work,  I encountered the error as in the picture. I didn't find any documents of used Erika3 for with aurix.  My opinion is that the problem is erika-v3. Because, I implemented this example code at Erika-v2 OS at Bifaces. It works very well. Maybe I forgot to modified conf.oil file at Erika-v3. Could you help me please, how I solve this problem?

 

 

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

HI MTG,

As the demo code is fine for your test, I suggest to debug which part of code impacts the CAN  module initialization.

You could disable some function and comment some code lines for verification.

i.e. PORT initialize,  Interrupt, Memory etc...

The purpose is to make the OS does not impact the CAN module initializaton.

 

 

 

 

0 Likes
MTG
Level 2
Level 2
5 questions asked 25 sign-ins 10 replies posted

Hi dw,

I did your said, I tried a lof combinations for two days. I have this problem when I want to configure a new node. (This function : IfxCan_Can_initNode()). I shared  this code. But I run the code, it gets stuck in the while loop that I marked in the IfxCan_Node_enableConfigurationChange  function.

MTGirgin_0-1645180172927.png

MTGirgin_1-1645180283133.png

 

 

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi,

You could initialize the CAN before the OS startup. It should be OK. Then you add OS part initialization.

0 Likes
MTG
Level 2
Level 2
5 questions asked 25 sign-ins 10 replies posted

Yes, that's how I do it.

But the problem is that the CAN module doesn't start. It hangs in the while loop in function IfxCan_Can_initNode().

MTG_0-1645181773814.png

 

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi MTG,

As you said for v2 is OK, so compare the code v2 and v3. The task should be not hard, because the OS is not started at all. 

0 Likes