my device needs to replug after reboot in linux

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

cross mob
E_521156
Level 4
Level 4
100 sign-ins 50 replies posted 50 sign-ins

Hi,
When my system reboots , it can't find FX3 in linux(I don't have this problem in windows).
I get "No device found", when I run cyusb_linux . (J4 is on). In linux, Fx3 needs to replug after reboot and then I can use it.
I attached the result of  lsusb -t  before repluging

 

Thanks

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please find my comments below:

1-I put the  SSLB img in 0x0000 and main img file in 0x6000. When I plug it, it boots with sslb img, how can I force it to start with 0x6000? (for combining img files I copied the sencond one in address 0x6000, is it ok?)

>> It seems that for this case you will be enabling the i2c boot macro such that the SSBL boots from I2C EEPROM. Is that correct? If yes, you can use the following 

static uint32_t gI2cByteAddrFW0 = 0x6000; //global variable

static CyBool_t
I2cInit (
        void)
{
    CyFx3BootErrorCode_t   status;
    CyFx3BootI2cConfig_t   i2cConfig;
    CyFx3BootI2cPreamble_t preamble;
    uint8_t               *rd_buf = (uint8_t *)gReadBuf;

    status = CyFx3BootI2cInit ();
    if (status != CY_FX3_BOOT_SUCCESS)
        return CyFalse;


    i2cConfig.busTimeout = I2C_BUS_TIMEOUT_VALUE;
    i2cConfig.dmaTimeout = I2C_DMA_TIMEOUT_VALUE;
    i2cConfig.isDma      = CyFalse;
    i2cConfig.bitRate    = I2C_FREQUENCY;
    status = CyFx3BootI2cSetConfig (&i2cConfig);
    if (status != CY_FX3_BOOT_SUCCESS)
        return CyFalse;

    preamble.buffer[0] = I2C_SLAVE_ADDRESS | I2C_CMD_WRITE;
    preamble.buffer[1] = GET_BYTE1(gI2cByteAddrFW0);
    preamble.buffer[2] = GET_BYTE0(gI2cByteAddrFW0);
    preamble.buffer[3] = I2C_SLAVE_ADDRESS | I2C_CMD_READ;
    preamble.length    = 4;
    preamble.ctrlMask  = I2C_START_BYTE2;

    status = CyFx3BootI2cReceiveBytes (&preamble, rd_buf, FW_HEADER_SIZE, I2C_RETRY_CNT);
    if (status == CY_FX3_BOOT_SUCCESS)
    {
        if ((rd_buf[0] == 'C') && (rd_buf[1] == 'Y') && (rd_buf[3] == 0xB0))
        {
            return CyTrue;
        }
    }

    return CyFalse;
}

 


2- I used CyU3PDeviceReset(CyFalse) with vendor commands to jump to bootloader. for reprogram RAM. I read in a thread that we should use CyU3PUsbJumpBackToBooter. which one is better to use?

>> If you want to jump back to SSBL from application firmware, you can use CyU3PUsbJumpBackToBooter function to transfer control back to the FX3 2-stage bootloader. Please refer to FX3 API guide for more details on this API

 

3- if I used  I2C boot macro, can I update the e2prom img file without changing pmode lines same RAM?

>> Please let me know how are you planning to update the application firmware .img file. Please refer to this blog FX3 Fail Safe Firmware Update - Cypress Developer Community and let me know if this is what you are looking for.

Kindly let me know if any queries on this

Regards,
Rashi

View solution in original post

0 Likes
14 Replies