Could you use halPolledDelay(x) and determine the X required?
Giovanni
[DONE] The New STM32F429/F439
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
-
trepidacious
- Posts: 58
- Joined: Mon Jan 21, 2013 3:36 pm
- Been thanked: 1 time
Re: [TODO] The New STM32F429/F439
I've had a look at this, and the results are a bit odd.
A halPolledDelay(1) instead of the 1ms sleep will fix things, I've tried it a few times in a row and it seems reliable. However if I run with a delay so that the USB starts normally, then remove the delay and reflash, it will also work. If I just use the reset button, it will start up again with no problem. However if I remove the mini-USB (and hence power down the MCU) then reconnect, it will not start up.
So the problem seems to be only on first power up, and only requires a very short delay in this case.
A halPolledDelay(1) instead of the 1ms sleep will fix things, I've tried it a few times in a row and it seems reliable. However if I run with a delay so that the USB starts normally, then remove the delay and reflash, it will also work. If I just use the reset button, it will start up again with no problem. However if I remove the mini-USB (and hence power down the MCU) then reconnect, it will not start up.
So the problem seems to be only on first power up, and only requires a very short delay in this case.
Re: [TODO] The New STM32F429/F439
This really sounds like some missing pull-ups/pull-downs somewhere... no?
~ Tectu
~ Tectu
-
trepidacious
- Posts: 58
- Joined: Mon Jan 21, 2013 3:36 pm
- Been thanked: 1 time
Re: [TODO] The New STM32F429/F439
6 of these will also work reliably, any less will only work sometimes:
Code: Select all
asm volatile("mov r0, r0");- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: [TODO] The New STM32F429/F439
OK, it seems a bus synchronization issue, it just requires a small delay. I'll search on the OTG manual for the cause of this. I'll add a small delay anyway.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: [TODO] The New STM32F429/F439
Hi,
I added a small delay to the reset procedure, could you please try the change? thanks.
Fixed as bug #436.
Giovanni
I added a small delay to the reset procedure, could you please try the change? thanks.
Fixed as bug #436.
Giovanni
Re: [TODO] The New STM32F429/F439
Just wondering... why is the STM32_VDD in the board file set to 300 instead of 330?
~ Tectu
~ Tectu
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: [TODO] The New STM32F429/F439
I see 3V on the schematic, it does not make difference anyway, it is the same working range.
Giovanni
Giovanni
-
trepidacious
- Posts: 58
- Joined: Mon Jan 21, 2013 3:36 pm
- Been thanked: 1 time
Re: [TODO] The New STM32F429/F439
Sorry for the delay - I didn't have the disco board over the weekend, the new code works fine for me 
On the 3V thing, it's due to a protection diode. The user manual says D1 and D2 on 5V and 3V supplies, but I think it's actually D3. The 407 discovery board had the same thing and it really irritated me, so I just replaced the diode with a wire to get 3.3V. As long as you don't try to use the 3V as a power input I think it's safe, but no guarantee
On the 3V thing, it's due to a protection diode. The user manual says D1 and D2 on 5V and 3V supplies, but I think it's actually D3. The 407 discovery board had the same thing and it really irritated me, so I just replaced the diode with a wire to get 3.3V. As long as you don't try to use the 3V as a power input I think it's safe, but no guarantee