Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - izzz

Pages: [1]
1
I'm using a MCF52235 microcontroller with uTasker as OS. I have a project with Ethernet support but I have problems when using it.

My project needs Ethernet because is partly based on a Website but, for example, if I turn on my board without Ethernet cable connected, my program gets stuck. I have seen that it stops in a while-loop waiting for a bit to set. That happens inside the fnMIIread function where the program waits until the MII flag of EIR is set. So it gets trapped ad-infinitum in this while-loop. I need to avoid it. Even if there're no Ethernet, my program can't get stuck!.

When the Ethernet cable is connected, there're no problems, it works fine. Are there a way to solve or avoid this behaviour?

2
I checked the interrupt priorities. There was a non-CAN interrupt (RXFRAME_INTERRUPT_PRIORITY) with same level/priority as CAN_interrupt_15. I changed it to level 4, priority 2 (because that lvl/pri was free) but still gets stuck.

I tried disabling and enabling the interrupts before and after softreset and seems that works. That can explain why and spurious interrupt is fired?

Regards,

Ivan

3
I tried what you said and here's the results:

1- The Stack Pointer is 0x20007F6C



2- I opened a View Memory window and found:
   + Exception 0x40602000:
      Format = 0x4
      Status Reg = 0x2000
      Vector = 0x18 (Reserved)
      Fault Status = 0x0 (Reserved)
   + Program Counter: 0x00020B9C



I don't know where's the problem, the vector and fault status are reserved.

3- Using the call stack I can't not found nothing interesting except that the exception is fired when accessing fnCAN



4- It seems that's a problem setting the SOFT_RESET bit, isn't it?



I replaced the for loop for a while loop but is always the same, it seems that the exception is fired always before entering in the wait-for-softreset-done loop

Any idea?

Regards,

Ivan

4
Hello,

I'm working with uTasker and MCF52235 microcontroller and I have problems when I try to SoftReset FlexCAN.

When I try to send/receive CAN messages, CAN_OTHER_INTERRUPT in uTasker is awaken. When that happens I try to reset FlexCAN, but often an unhandled exception (0x40602000) occurs when doing so the program enter in the while(1) defined inside de handler undef_int(void) in M5223X.c and stands there forever.

All the CAN interrupts are initialized (_CAN_buf_Interrupt0 to 15, _CAN_bus_off_Interrupt and _CAN_error_Interrupt) so every one has a handler.

I'm having problems when I use long cables between two boards communicated by CAN bus. I have the termination resistors at the end and at the begin of the cables.

This is my SoftReset FlexCAN code:

void fnResetCAN(void){
    unsigned int counter;
    if (CAN_ERRSTAT & (CAN_BUS_IDLE|CAN_ERROR_PASSIVE)){
    unsigned int imask = CAN_IMASK;
    unsigned int canmcr = CANMCR;
        CANMCR |= CAN_SOFTRST;
        for (counter=0; counter<500, (CANMCR & CAN_SOFTRST);counter++){}
          CAN_IMASK = imask;
       CANMCR |= canmcr;
       CANMCR &= ~(CAN_FRZ | CAN_HALT);

    }
}

Hope you can help me,

Ivan

Pages: [1]