[DONE] The New STM32F429/F439

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
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

Post by Giovanni »

If you post the initialization code I will add it to board.c.

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: [TODO] The New STM32F429/F439

Post by Tectu »

trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Re: [TODO] The New STM32F429/F439

Post by trepidacious »

Might not be all that interesting to anyone else, but self-refresh seems to work fine, I've added some shell commands to test it:
https://github.com/trepidacious/ChibiOS-RT-Community/commit/a98f4269f9f5bfc805c646fe4cbf3fc0b30db7d0
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: [TODO] The New STM32F429/F439

Post by Tectu »

Send a pull request 8-)


~ Tectu
User avatar
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

Post by Giovanni »

Does LD5 lights up when you plug the USB cable? I continue to don't understand what is causing that.

I also noticed that you guys stopped at different memory addresses, it is like you are using different toolchains or a modified code.

Giovanni
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Re: [TODO] The New STM32F429/F439

Post by trepidacious »

Yes, the LED comes on when micro USB is attached, this happens on the USB serial firmware and also my version without USB serial.
I was using the summon arm toolkit, but I've switched to the GNU ARM embedded toolchain, I think this is the same version of the toolchain as ChibiStudio. I now get:

Code: Select all

0x080075ea in otg_core_reset (usbp=0x20001148) at ../../os/hal/platforms/STM32/OTGv1/usb_lld.c:133
133     while ((otgp->GRSTCTL & GRSTCTL_CSRST) != 0)


Using my non-usb demo I get the following from shell info command - does this match yours?

Code: Select all

Compiler:     GCC 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601]


arm-non-eabi-gcc --version reports:

Code: Select all

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601]


Obviously things might still be different since I'm compiling on Linux, I don't know whether the Linux and Windows versions of the same toolchain release will necessarily give exactly the same binaries, would be nice if they did ;)
User avatar
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

Post by Giovanni »

This could be something in the board setup files, could you check the pins related to USB? it is possible I am missing something obvious there.

Giovanni
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Re: [TODO] The New STM32F429/F439

Post by trepidacious »

Looks fine to me, the settings look very similar to board file for 407, except that VBUS is pulled down on 429, it doesn't seem like that should make any difference though. Would I be right in thinking that the loop that hangs is resetting the USB peripheral? That seems like the kind of thing that should just work regardless of anything else?
User avatar
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

Post by Giovanni »

That loop waits for the peripheral to come out of the software reset, it is like the peripheral is stuck for some reason.

Could you try adding delays around that code and see if it makes any difference?

Giovanni
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Re: [TODO] The New STM32F429/F439

Post by trepidacious »

Great, that fixes it!

Code: Select all

static void otg_core_reset(USBDriver *usbp) {
  stm32_otg_t *otgp = usbp->otg;

  //FIXME: Makes things work for me, otherwise hangs on following loop.
  chThdSleepMilliseconds(1);

  /* Core reset and delay of at least 3 PHY cycles.*/
  otgp->GRSTCTL = GRSTCTL_CSRST;
  while ((otgp->GRSTCTL & GRSTCTL_CSRST) != 0)
    ;
  halPolledDelay(12);
  /* Wait AHB idle condition.*/
  while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0)
    ;
}
Post Reply