- This topic has 4 replies, 2 voices, and was last updated 8 years, 8 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › mistake
Hello
I think there is a mistake on page 209.
It’s written: “At time t3 also C IRQ fires”, but I think it’s at time t2
Hi Louis,
Yes you are right. The the right time is T2. I’ll fix it in the next release. Really thanks to let me know this.
Regards,
Carmine
I have another question. My GPIO_InitTypeDef looks like this:
1 2 3 4 5 6 7 |
typedef struct { uint32_t Pin; uint32_t Mode; uint32_t Pull; uint32_t Speed; }GPIO_InitTypeDef; |
There is no uint32_t Alternate;
.
Is this a setting in CubeMX, or maybe a HAL update?
How can I choose an alternate function if it’s not there?
Probably you are working on an STM32F1xx MCU. GPIOs in STM32F1 MCUs can’t be easily remapped to other features, since the remapping feature is really limited. A pin can essentially have two modes: output/input push pull and alternate function push pull. When you want to use a GPIO as signal I/O of a given peripheral, then you first define the GPIO as alternate function push pull and then enable the peripheral. The binding peripheral=GPIOs is hardwired. Only few peripherals (for example the USART3 in an STM32F103 MCU) can assign I/Os to different GPIOs by performing a sort of “software remap”. Take a look at the stm32f1xx_hal_gpio_ex.h module.
That’s essentially is the reason why that field is omitted in CubeF1 HAL.
Ok, now everything is clear.
Thank you!