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.

TMS320F28379D: Function InitFlash() in F2837xD_SysCtrl.c does things differently from the TRM

Part Number: TMS320F28379D


Hello,

The function provided by TI to initialize the flash bank and pump runs the following operations:

    //
    // At reset bank and pump are in sleep. A Flash access will power up the
    // bank and pump automatically.
    //
    // After a Flash access, bank and pump go to low power mode (configurable
    // in FBFALLBACK/FPAC1 registers) if there is no further access to flash.
    //
    // Power up Flash bank and pump. This also sets the fall back mode of
    // flash and pump as active.
    //
    Flash0CtrlRegs.FPAC1.bit.PMPPWR = 0x1;
    Flash0CtrlRegs.FBFALLBACK.bit.BNKPWR0 = 0x3;

I'm trying to understand what this snipped does exactly, based on the TRM chapter 2.12.6 Flash and OTP Power-Down Modes and Wakeup.

  1. The first sentence in the comment above states that a flash access will power up the bank and pump automatically. No problem, this is exactly what the TRM states.
  2. The second sentence states that after a flash access they go back to low power mode. As far as I understand, this is only true after you perform all 10 steps of the power-down sequence described in the TRM, so unless I perform this sequence the bank and pump will not go back to low-power mode when there is no access to flash. Can someone confirm that my understanding is correct? I wouldn't want the flash bank to automatically go back to sleep every time the CPU enters a part of my code which is run from RAM.
  3. The third sentence does not make sense to me. If the power up is automatic then why on earth does our code need to do anything? In the TRM the description of the FBFALLBACK register says that "If the bank and pump are not in active mode and an access is made, the value of this register is automatically changed to active".

So are these two lines really necessary and if they are, why?

Cheers,

Pierre

  • Pierre,

    #2. Once the FBFALLBACK mode is configured for active (which happens upon a Flash access or by register write in FBFALLBACKregister), flash bank will never go back to sleep unless you configure it to sleep again.

    Steps mentioned in the TRM are to put the pump to sleep as well (which is tricky since there are two core/FMCs using it and hence mentioned the procedure). Pump also does not go to low power mode once it is configured for active (which happens upon a Flash access or by register write in PMPPWR bit-field).

    Earlier, there was a feature wherein users can configure the fallback to sleep and bank/pump can fall to sleep after a configurable grace period (provided no access is made within that grace period). However, since most of the control applications do not want to cause delays in their application response, we removed that feature. Comments that you see in the code need to be modified. I will file a ticket for the same.

    #3. Agreed that an access will power it up. Since the registers are provided to configure low power modes, some customers like to make sure they configure the fallback as active and hence the code is added.

    Thanks and regards,
    Vamsi

  • Thank you Vamsi, it's crystal clear.

    Regards,
    Pierre