ikonos

liblan8700BF527 Bug?

Discussion created by ikonos on Nov 22, 2010
Latest reply on Dec 6, 2010 by PrasanthR

Hi,

 

we have possibly found some bug in the liblan8700BF527 library.

 

1.) In some random, but rare cases we don't get a ethernet connection to our board. (Custom board)

So we connected to the serial line and found out, that the OPMODE-register EMAC_OPMODE ist set to 0x1810000 and not to 0x1810001.

We set the RX-Bit now manually to prevent this behaivour and get no error so far.

 

2.) Another "maybe bug" is the fact, that you enable the interrupt mask before you Hook the interrupts.

 

        // set the imask
        dev->IntMask = ~((1<<dev->RXIVG) | (1<<dev->TXIVG) | (1<<dev->EtherIntIVG) );


        // hook the RX,TX complete interrupts
        res = adi_int_CECHook(dev->RXIVG,RxInterruptHandler,dev,false);

        ...

 

3.) And the last thing is: We have to disable all four nested interrupts in this module, because we get exception resulting from the driver.

 

 

to 1.) I have to say, that we have three binaries programmed in the flash, and we jump from our bootloader to our applic.

We do so by the following code:

 

// R0 contains the address of the executable
_Load:

 

    cli r5;
    R1 = 0;
    /* Achtung!! kein softreset hier */
    P0.H = HI(0xEF000008);
    P0.L = LO(0xEF000008);

 

    JUMP (P0) ; /* jump to Boot ROM */
_Load.end:

 

Before we jump we have to disable the lwip ethernet-stack:

 

int system_deinit(void)
{
    int result;
    result = adi_dev_Control(lan_handle,ADI_ETHER_CMD_SHUTDOWN_DRIVER,(void*)TRUE);
   
    stop_stack();
    memset(ether_stack_block,0,ETHER_STACK_SIZE);
    free(ether_stack_block);
   
    return(0);
}

 

And although we have to disable the cache.

 

/*******************************************************************************************
*******************************************************************************************/
void disable_caches(void)
{
    *pIMEM_CONTROL = 0x0001;
    asm("CSYNC;");
    *pICPLB_DATA0 = 0;
    *pICPLB_DATA1 = 0;
    *pICPLB_DATA2 = 0;
    *pICPLB_DATA3 = 0;
    *pICPLB_DATA4 = 0;
    *pICPLB_DATA5 = 0;
    *pICPLB_DATA6 = 0;
    *pICPLB_DATA7 = 0;
    *pICPLB_DATA8 = 0;
    *pICPLB_DATA9 = 0;
    *pICPLB_DATA10 = 0;
    *pICPLB_DATA11 = 0;
    *pICPLB_DATA12 = 0;
    *pICPLB_DATA13 = 0;
    *pICPLB_DATA15 = 0;
    asm("CSYNC;");
    *pDMEM_CONTROL = 0x1001;
    asm("CSYNC;");
}

 

/*******************************************************************************************
*******************************************************************************************/
void ApplicBootThread_ApplicStart(void)
{
    int system_deinit(void);
    void Load(int);

 

    VDK_PushUnscheduledRegion();
    asm("CSYNC;");
    VDK_PushCriticalRegion();
    asm("CSYNC;");


    disable_caches();

 

    /* shutdown LwIp-Stack */
    system_deinit();

 

   Load(APPLIC_START_ADDRESS);    //0x20100000);
}

 

 

 

Thanks

Daniel

Outcomes