2017-01-06 01:16 PM
Our application uses the SMT32L4 in a 4-20mA loop-powered transmitter. VCC on this device is 3V. The typical current draw once the product is operational is approximately 8mA @ 3v. We are utilizing the bootloader to program the mcu with UART1 on pins 68-69 (PA9 and PA10). On some boards, prior to programming, there is approximately 40-50mA current draw on the 3V supply. Our supply is rated for 50mA and once we attempt to initiate bootloading, the current consumption increases beyond that limit. If we provide enough current by increasing the supply, the device programs successfully. Once programmed, the total draw on the 3V supply is the expected 8mA.
I am wondering if there is a known operation/current consumption for these devices before they are initially programmed. Also, I see that the bootloader can use USART1/2/3, I2C1/2/3, and DFU (USB). Which ports/pins are utilized for the USART and I2C channels during bootloader operation? There are several ports that can be configured for each of these channels during normal operation, so it is difficult to determine the exact pin configuration of the device when it is in bootloader mode.Thank you!Gary#programming #high-current #bootloader #stm322017-01-06 01:28 PM
For the USART pins, the System Loader has the RX pins connected to timers to allow it to watch for signals and auto-baud.
It is supposed to be looking for transitions on key pins it might get connectivity on.
I'd perhaps focus on the USB pins, and if you have pull up/down on the BOOTx pins.
If there are some boards which are much lower initially than the 40-50mA quoted, then I'd probably see what's different about them, and if you have some shorts, either in the solder of the pads, or within the board structure. Perhaps pull the STM32 and see if things are still oddly high. See if it follows the STM32 if place on a different board. I'd expect consistency, the lack of it tends to be a red flag.
2017-01-06 02:01 PM
One thing we discovered is that the L4 devices' bootloader enables the CAN peripheral, configures PB9 as output and drives that pin high.
2017-01-06 05:29 PM
Good observation, I'll remember that.
2017-01-07 02:50 AM
Which ports/pins are utilized for the USART and I2C channels during bootloader operation?
The bootloader appnote (AN2606? Not sure with number I am not at a computer) goes into deep details with this.
JW
2017-01-07 08:26 PM
My STM32L4 application uses the 100 pin LQFP and has 49 leds to individual pins. I was surprised when I first entered the Bootloader that 5 Leds lit up (some only dimly). Pity there is no way to tell the chip I only ever want to use USART1. My application also draws about 10 mA (most of the time), but during programming my board draws around 50mA - but 30 mA of that is probably the FET driven white Led it lights up.
2017-01-09 06:15 AM
Thanks everyone for the helpful comments, I appreciate it. I had overlooked AN2026 section detailing specific pins and their initial states... I have found that info now. I was also able to read the Bootloader ID to determine that we have v9.2 bootloader which uses USART 1/2/3, CAN 1, USB, I2C 1/2/3, and SPI 1/2. I have confirmed our pinout is not an issue for v10.x which does not use CAN or SPI. I will check our pinout for SPI 1/2 and CAN now that I know we have the v9.x bootloader.
2017-01-09 07:45 AM
Thanks! USB terminals not connected to anything. Only one BOOT pin on this device, BOOT0, which has a pull-down
2017-01-09 12:31 PM
We have adjusted the 3V supply in our test environment so that it can provide as much current as is required for programming a board which has no valid firmware (new unit or erased). We got some interesting results...
AN2606 states that 'pattern 7' must be applied in order to enter bootloader. Pattern 7 can be any one of the following:
Boot0(pin) = 1, nBoot1(bit) = 1 and BFB2(bit) = 0
Boot0(pin) = 0, BFB2(bit) = 1 and both banks don’t contain valid codeBoot0(pin) = 1, nBoot1(bit) = 1 and BFB2(bit) = 1Interestingly, the case where a device is brand new or has been erased is not listed. In this case, the condition would be:
Boot0(pin) = 0, BFB2(bit) = 0 and both banks don’t contain valid code
What I have to assume this to mean is that if [Boot0(pin) = 0, BFB2(bit) = 0 and both banks don’t contain valid code], the device will not enter bootloader. But if it is brand new, there is no valid code to run, so what does it do??
We found that when power is applied to a new or erased unit, regardless of the BOOT0 pin state, it will draw about 22mA for a second, then 75mA for about a second, then 88mA for about 0.5 seconds, then about 6mA forever until programming begins. Programming/erasing etc usually draws around 32mA. Our issue is that since this is not noted anywhere, we designed our 3V supply @ 50mA (65mA short-circuit). So we have some units that are able to get over the 88mA peak 'on accident' and therefore can program, while other units can't, and just sit there pulling down the 3V supply to around 2V, preventing any interaction.
Does anyone know what the STM32L476 is doing during it's startup that could possibly consume that much current??? We can't explain it, but it is repeatable across several units.
2017-01-09 01:53 PM
Anything beyond 10mA sounds rather suspicious, but can't that be other circuitry on the board? Are there significant capacitances to be charged? How exactly are the NRST, VDDA/VSSA, VBAT, VDDIO pins connected? Are all ground pins connected? Is the rise of VDD monotonic?
JW