Why am I getting the above error? I have included the "pal_lld.h" header file. Here is a snippet of my code. The PAL driver is ticked on.
#include "pal_lld.h"
void set_pin(bool state){
state ? pal_lld_setpad(PORT_G, 1) : pal_lld_clearpad(PORT_G, 1);
}
PORT_G undeclared (first use in this function, HAL, pal_lld.h
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: PORT_G undeclared (first use in this function, HAL, pal_lld.h
Hi mng,
It is the first time that I see this notation:
I think, you must use GPIOG instead of PORT_G.
You can have a look at the demo for the Nucleo f401re board.
It is under: trunk/demos/STM32/RT-STM32F401RE-NUCLEO64 if you are using trunk for example.
It is the first time that I see this notation:
PORT_G
I think, you must use GPIOG instead of PORT_G.
You can have a look at the demo for the Nucleo f401re board.
It is under: trunk/demos/STM32/RT-STM32F401RE-NUCLEO64 if you are using trunk for example.
regards,
Theo.
Theo.
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: PORT_G undeclared (first use in this function, HAL, pal_lld.h
Hi,
take a look to default demo. You have to include hal.h only and enable pal driver in halconf.h
Note that with STM32 the ports are usually named as GPIOx where x is the port identifier (A, B, C, D, and so on)
take a look to default demo. You have to include hal.h only and enable pal driver in halconf.h
Note that with STM32 the ports are usually named as GPIOx where x is the port identifier (A, B, C, D, and so on)
Ciao,
RM
RM
Re: PORT_G undeclared (first use in this function, HAL, pal_lld.h
Thanks Rocco. You are right about hal.h. I managed to figure it out. The macro "PORT_G" is correct. I just had to add hal.h instead of pal_lld.h
LG
ngm
LG
ngm
Re: PORT_G undeclared (first use in this function, HAL, pal_lld.h
tfAteba wrote:Hi mng,
It is the first time that I see this notation:PORT_G
I think, you must use GPIOG instead of PORT_G.
You can have a look at the demo for the Nucleo f401re board.
It is under: trunk/demos/STM32/RT-STM32F401RE-NUCLEO64 if you are using trunk for example.
The macro was right. I just had to add the header file hal.h not pal_lld.h
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: PORT_G undeclared (first use in this function, HAL, pal_lld.h
Hi ngm!
About you macro, (PORT_G) it was the first time that I saw it.
I think that it is must be the original name of the port of a GPIO for your hardware.
So Just for my information can you tell me the name of your target board? and the version of chibios that you are using?
GPIOG must also work, it is may be an alias of your macro.
It confirm what I said.
Did you test this macro?
Any way, thank you for your feed back and I m glad that you resolved you problem that is the most important.
About you macro, (PORT_G) it was the first time that I saw it.
I think that it is must be the original name of the port of a GPIO for your hardware.
So Just for my information can you tell me the name of your target board? and the version of chibios that you are using?
GPIOG must also work, it is may be an alias of your macro.
rocco wrote:
Note that with STM32 the ports are usually named as GPIOx where x is the port identifier (A, B, C, D, and so on)
It confirm what I said.
Did you test this macro?
Any way, thank you for your feed back and I m glad that you resolved you problem that is the most important.
regards,
Theo.
Theo.
Who is online
Users browsing this forum: No registered users and 3 guests