Main Site Documentation

G400 firmware update


#1

Hello,
I tried to start with CAN on the G400 module. I made my own board with LCD display and with 2 CAN drivers. I tried to made an example code from GHI web sites for introduction and communication between G400 and Kvaser USB/CAN.

I didn’t have a problem with first deploying, but the program didn’t work and G400 has a text “ABORT data” on LCD display. The worst is I can’t to update my G400 module using FEZConfig software. I tried to make it again with the other G400 module and I have 2 dead modules. :slight_smile:

Thank you for the answers.

My code is:


static CAN.Message[] TxMessages;
static CAN.Message[] RxMessages;
public static bool Error = false;
        
public static void Main()
{
int T1, T2, BRP;
//Bitrate 250 kbit/s
BRP = 24;
T1 = 15;
T2 = 8;

TxMessages = new CAN.Message[1];
RxMessages = new CAN.Message[1];
for (int i = 0; i < TxMessages.Length; i++)
{
    TxMessages[i] = new CAN.Message();
}
CAN AntriebCAN = new CAN(CAN.Channel.Channel_1, (uint)(((T2 - 1) << 20) | ((T1 - 1) << 16) | ((BRP - 1) << 0)));

AntriebCAN.DataReceivedEvent += AntriebCAN_DataReceivedEvent;
AntriebCAN.ErrorReceivedEvent += AntriebCAN_ErrorReceivedEvent;

TxMessages[0].ArbID = 100;
TxMessages[0].Data[0] = 1;
TxMessages[0].DLC = 1;
TxMessages[0].IsEID = false;
TxMessages[0].IsRTR = false;

            
while (true)
{
    if (Error == false)
        AntriebCAN.PostMessages(TxMessages, 0, 1);
    else
        Error = false;
    Thread.Sleep(1000);
}

Debug.Print("Sleeping...");
Thread.Sleep(Timeout.Infinite);
}
        
static void AntriebCAN_DataReceivedEvent(CAN sender, CANDataReceivedEventArgs args)
{
    Debug.Print("Data received event");

    int count = sender.GetMessages(RxMessages, 0, 1);
    Debug.Print("MSG: ID = " + RxMessages[0].ArbID + " at time " + RxMessages[0].TimeStamp);
}

static void AntriebCAN_ErrorReceivedEvent(CAN sender, CANErrorReceivedEventArgs args)
{
    Debug.Print("Error received");
    Error = true;

switch (args.Error)
{
    case CAN.Error.Overrun:
         Debug.Print("Overrun error");
        break;
    case CAN.Error.RXOver:
        Debug.Print("RXOver error");
    break;
    case CAN.Error.ErrorPassive:
         Debug.Print("Error Passive");
    break;

}
}



#2

@ Thomas_H -

try to keep PA04 (usually called LDR1) low then hit RESET
The board will run in TinyBooter mode then you can re-flashing again.

That is because your code look up the board. Next time, you should add a button, it can be PA04. Your application should be start after pressed this button (just for testing).

Input ldr1 = new Input....
while(ldr1.Read()== true)
{
    Thread.sleep(100);
}

// start your code....

You can remove that cheat after your code run stably


#3

@ Thomas_H -

it looks like 4.2, what exactly firmware you are using that causes this problem, please?


#4

step through the firmware update process that Dat talks about, making note of the devices that appear on Device Manager on your PC as you go. Apply the firmware. report back on what SDK version and firmware version you have on the PC and on the target board. Deploy only a blinking LED program to make sure that all works before you deploy your own app again


#5

Hello guys,
thank you for the answers.

@ Dat: Yes, I made the buttons RESET, LDR0 and LDR1 on my board. It is possible to start G400 in TinyBooter mode, but the flashing is interrupted (see attached pictures). If I will start to flash again, everything is working normally and firmware is updated, but G400 after automatic RESET after firmware update has the same message on LCD like in the picture when I started this thread.


#6

@ Brett: It is not possible to deploy the application because G400 doesn’t communicate with Visual Studio.


#7

@ Thomas_H -

Try to update tinybooter too, that may because tinyBooter and TinyCLR are not match.

https://www.ghielectronics.com/docs/177/loader-tinybooter show how to update g400 Tinybooter


#8

I get the interrupted error if I try to use a USB3 connection on the PC or go through a HUB.


#9

@ Dave McLaughlin -

[quote]
“USB3 connection on the PC or go through a HUB”[/quote]

it might not happy with this way. :slight_smile: