I was getting the FSMC driver from ChibiOS/GFX to work on a Hy-MINI STM32V and while I got the demos going (see http://imgur.com/5VGJBef) I ran into a couple of roadblocks along the way, mainly to do with the PAL differences:
I took SSD1289/gdisp_lld_board_example_fsmc.h and modified it
- what is meant to define STM32F1XX? I ended up defining it in my board.h but I'm not sure of the right place for it to go
- the original code has
palSetBusMode(&busD, PAL_MODE_ALTERNATE(12));
palSetBusMode(&busE, PAL_MODE_ALTERNATE(12));
but for GPIOv1, I needed
palSetBusMode(&busD, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetBusMode(&busE, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
I'm not sure what the accepted way of writing things that are portable across the two GPIO interfaces is.
GPIOv1/v2 PAL #defines
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: GPIOv1/v2 PAL #defines
Hi,
GPIOv1 and GPIOv2 have very different features so there is no commonality except for a subset of the modes (not alternate modes anyway).
GPIOv1 is limited to STM32F1 devices, all newer families use GPIOv2.
In general would be a good idea to keep GPIO configuration out of high level modules and confine it to board.h or the initial setup performed in the main().
Giovanni
GPIOv1 and GPIOv2 have very different features so there is no commonality except for a subset of the modes (not alternate modes anyway).
GPIOv1 is limited to STM32F1 devices, all newer families use GPIOv2.
In general would be a good idea to keep GPIO configuration out of high level modules and confine it to board.h or the initial setup performed in the main().
Giovanni
Re: GPIOv1/v2 PAL #defines
sorry to resurrect the thread.
are you successfully made ugfx works on Hy-MINI STM32V? could you share your code?
Thanks,
Wagner
are you successfully made ugfx works on Hy-MINI STM32V? could you share your code?
Thanks,
Wagner
Re: GPIOv1/v2 PAL #defines
Hello!
How to choose v2 version of HAL?
I use stm32F107 and this code is not build:
How to choose v2 version of HAL?
I use stm32F107 and this code is not build:
Code: Select all
palSetPadMode(GPIOD, 5, PAL_MODE_ALTERNATE(7));
palSetPadMode(GPIOD, 6, PAL_MODE_ALTERNATE(7));
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: GPIOv1/v2 PAL #defines
Hi,
STM32F1 is not compatible with all others.
PAL_MODE_ALTERNATE(n) is only available on newer devices. You need to initialize pins using the F1-specific macros (look into ./os/hal/ports/STM32/LLD/GPIOv1/pal_lld.h).
Giovanni
STM32F1 is not compatible with all others.
PAL_MODE_ALTERNATE(n) is only available on newer devices. You need to initialize pins using the F1-specific macros (look into ./os/hal/ports/STM32/LLD/GPIOv1/pal_lld.h).
Giovanni