Turn on Led - Psoc 6

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RoFr_4201436
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello guys, I'm trying to make a program to turn on a led, but the following error appears for me: "Build error: undefined reference to `LED_Write'"

Someone can help me?

RoFr_4201436_0-1612622047017.png

 

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Yes, the difference in APIs of PSoC 6 really bothers me, too.

But I think that it has its meaning.

 

If you have LED pin in your schematic you should be able to write something like

Cy_GPIO_Write(LED_PORT,  LED_NUM, 0) ;

 

While ago, I posted my sample of using basic component(s).

Please download it and take a look at in the source files, such as gpio_utils.c, etc.

https://community.cypress.com/t5/Code-Examples/MCU-Tester-a-Swiss-Army-Knife-for-PSoC-CY8CKIT-062-BL...

 

moto

View solution in original post

2 Replies
lock attach
Attachments are accessible only for community members.
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @RoFr_4201436 ,

Here's what you need to note while programming PSoC 6 devices using PSoC Creator IDE : The PSoC 6 Component is built on top of the PDL.  For PSoC 6, the Component API uses the PDL. PDL 3.0 is a separate entity. This has been explained thoroughly with the help of an example in our community blog : PSoC 6 Components and PDL Drivers - Cypress Developer Community . The reason you are getting the build errors is the usage of APIs that are different from the PDL APIs. Please go through the GPIOs Peripheral driver library and the associated APIs here : PSoC 6 Peripheral Driver Library: GPIO (General Purpose Input Output) (cypresssemiconductorco.github....

Also for your reference, I have created a demo project and attached here for the clear understanding of APIs ' working. In this project, I have tried to blink the Red and blue Led on board alternatively with a delay of 1 sec in between. The APIs Cy_GPIO_Write() and Cy_SysLib_Delay() help achieve the output, where Cy_GPIO_Write() writes a logic 0 or 1 state to the output driver and Cy_SysLib_Delay() provides delay in mili seconds.  I have used CYBLE-416045-02 module to test the project. 

NOTE: If using the PSoC Creator IDE, there is no need to initialize the pins when using the GPIO component on the schematic. Ports are configured in Cy_SystemInit() before main() entry.

Please go through the provided information once and let us know in case of further queries.

Best Regards,

Aashita

 

 

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Yes, the difference in APIs of PSoC 6 really bothers me, too.

But I think that it has its meaning.

 

If you have LED pin in your schematic you should be able to write something like

Cy_GPIO_Write(LED_PORT,  LED_NUM, 0) ;

 

While ago, I posted my sample of using basic component(s).

Please download it and take a look at in the source files, such as gpio_utils.c, etc.

https://community.cypress.com/t5/Code-Examples/MCU-Tester-a-Swiss-Army-Knife-for-PSoC-CY8CKIT-062-BL...

 

moto