This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/UCD3138: what does "pmbus_read_write_rom_mode(PMBUS_WRITE)" mean in main.c

Part Number: UCD3138

Tool/software: Code Composer Studio

In the UCD3138LLCEVM-028 code, in main.c there is a code copied below, what does it mean?

//Check to see if FAULT2 is pulled high and FAULT0 is pulled low.
//If they are go to ROM.
if (MiscAnalogRegs.GLBIOREAD.bit.FAULT2_IO_READ && !MiscAnalogRegs.GLBIOREAD.bit.FAULT3_IO_READ)
{
pmbus_read_write_rom_mode(PMBUS_WRITE);
}

  • As you probably know UCD3138 has a ROM bootloader.

    After power up UCD3138 always start executing ROM. ROM with check the content of program Flash(PFlash) vs. the PFlash checksum and if everything OK, it will start executing your firmware in the PFlash.

    The function pmbus_read_write_rom_mode sends the UCD3138 back to execute ROM, so you will be able to download a different firmware using the ROM bootloader and PMBus.

    This function sends to ROM by clearing the checksum and perform a software reset.

    The if part in the code that you pasted is looking at the combination of status of two GPIO lines (FAULT2 and FAULT3) to decide whether to act or not.
    This if condition should not be TRUE during normal operation of firmware. Only if you want to use the GPIO pins to go back to ROM, you can hold the pins in the proper state.

    Hope this makes sense.

    If above addresses your question please set the status of this post to resolved.

    Regards,

  • Hi Yitzhak,

    I noticed that there 2 ways for triggering mcu reset after the clearing checksum function was done by case 12 between latest code and previous code, may I know why it uses triggering software reset instead  point function to illegal address, thanks.

  • The use of SysRegs to apply a software reset the better choice!

    The first option tries to force an exception by accessing an illegal location.

    That in turn will cause a reset. But the second option is preferable.

  • If the above addresses your question, please set the status of this post to resolved.
    Regards,