It looks like a wrong interrupt vector is used, check the registry.
Giovanni
STM32L4 support Topic is solved
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
Re: STM32L4 support
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
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
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
Re: STM32L4 support
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.
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
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.
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.
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
Re: STM32L4 support
Hi,
STM32L4 uses GPIOv3. Masks are:
Ciao
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
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?
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);
}
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
Re: STM32L4 support
Note that the EXTI is enabled for half period each 10 second. You should change your code in:
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
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