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.


Topics - 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
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]