Page 5 of 5

Re: STM32L4 support

Posted: Mon Nov 28, 2016 4:39 pm
by Giovanni
It looks like a wrong interrupt vector is used, check the registry.

Giovanni

Re: STM32L4 support

Posted: Mon Nov 28, 2016 5:03 pm
by RoccoMarco
Can you place a breakpoint in usb_lld_read_setup and check where it hangs?
Set O0 in makefile. Thanks for your time. If you are busy do not worry, I will made a cable in the next days.

Edit: I have found another wrong thing in the registry and this could be the source of the problem

Re: STM32L4 support

Posted: Mon Nov 28, 2016 5:59 pm
by DEHiCKA
Thanks, it works now!

Re: STM32L4 support

Posted: Mon Nov 28, 2016 7:12 pm
by RoccoMarco
Thank you for your time.

Re: STM32L4 support

Posted: Fri Dec 09, 2016 11:25 pm
by drakon
I am trying to get SPI running on this board. I get following error message during compilation:

main.c:184:42: error: 'PAL_STM32_OSPEED_HIGHEST' undeclared (first use in this function)
PAL_MODE_ALTERNATE(5) | PAL_STM32_OSPEED_HIGHEST); /* New SCK */

What could be wrong with it? If I remove PAL_STM32_OSPEED_HIGHEST from my code the compilation is successful.

Re: STM32L4 support

Posted: Sat Dec 10, 2016 4:24 pm
by tfAteba
Hi Drakon,

Wich version of ChibiOS do you use?

I looked into trunk, and "PAL_STM32_OSPEED_HIGHEST" is define in os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.h
.

So if you are using GPIOv1 or GPIOv3", it is normal, that macro is not define there.

Re: STM32L4 support

Posted: Sat Dec 10, 2016 5:02 pm
by RoccoMarco
Hi,
STM32L4 uses GPIOv3. Masks are:

Code: Select all

#define PAL_STM32_OSPEED_MASK           (3U << 3U)
#define PAL_STM32_OSPEED_LOW            (0U << 3U)
#define PAL_STM32_OSPEED_MEDIUM         (1U << 3U)
#define PAL_STM32_OSPEED_FAST           (2U << 3U)
#define PAL_STM32_OSPEED_HIGH           (3U << 3U)

Ciao

Re: STM32L4 support

Posted: Sat Dec 10, 2016 11:58 pm
by drakon
Thank you! It works.

Another one problem I got now is to get the EXT subsystem running on the stm32L432 board. In the project "testhal/STM32/STM32L4xx/EXT" I changed the port to PC14, but the board doesn’t respond to the changes on that port. Any idea?

Code: Select all

static const EXTConfig extcfg = {
  {
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_BOTH_EDGES | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOC, extcb1},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL}
  }
};


Code: Select all

  while (true) {
    chThdSleepMilliseconds(5000);
    extChannelDisable(&EXTD1, 14);
    chThdSleepMilliseconds(5000);
    extChannelEnable(&EXTD1, 14);
  }

Re: STM32L4 support

Posted: Sun Dec 11, 2016 12:18 am
by RoccoMarco
Note that the EXTI is enabled for half period each 10 second. You should change your code in:

Code: Select all

  extChannelEnable(&EXTD1, 14);
  while (true) {
    chThdSleepMilliseconds(500);
  }


BTW PC14 and PC15 are connected to the external XTAL. It is not a free pin. (I am supposing you are talking about STM32 Nucleo-32 L432)
Ciao