cancel
Showing results for 
Search instead for 
Did you mean: 

led blinking

Jad
Associate III

good morning

i want to create a simple led blinking code. for that, i got the path of the led 8 of my aek-mcu-c4mlit1. it is pk1gpio1 and is connected to the branch 25. i connected it on the gui and wanted to code in my main. unfortunately, C recognizes port k but not the pin that i just pinned and the function that makes it blinks. so my 2 questions are: how to make it recognize the pin and how to get functions that work 

kind regards

Jad_0-1725628089535.png

Jad_1-1725628126891.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ATROI
ST Employee

Hi Jad,

 

in my copy and paste there was an error.

Pls replace the line:

siul_lld_readpad(PORT_PIN_GPIO36, PIN_GPIO36);rqIsrEnable();

with 

siul_lld_readpad(PORT_PIN_GPIO36, PIN_GPIO36);

now it should work.

Thanks,

AutoDevKit Team

P.S.

if you open the welcome page in AutoDevKit, see the image below, you can find the same tutorial that can help.

ATROI_0-1725639132726.png

 

 

View solution in original post

10 REPLIES 10
ATROI
ST Employee

Hi Jad,

After you set a pin in the Pin Map Editor you have to:

- Save and close the Pin Map Editor.
- Save the project.
- Generate the code (click on the following icon).

ATROI_0-1725630287073.png


After this step, you will see that the tool recognizes the PIN Name as a variable.

In your case, if the name of the PIN is PIN_GPIO161, the function you are using wants as a parameter (PORT_PIN_GPIO0161, PIN_GPIO0161).

 

Thanks,

AutoDevKit Team

Jad
Associate III

thank you very muh for the quick response. neverless, i still  have the same error messages and now my pinmap editor has completly changed and there is no more gpio 161 at branch 25. the number of branch ha reduced and is no more le the number on my data sheet

Jad_0-1725630673230.png

kind regards

Hi Jad, 

pls. start from scratch, crate new project and follow 

the steps I suggested before, it should work.

Thanks,

AutoDevKit Team. 

Jad
Associate III

thanks, it worked for the pin :) neverless i still have the other main problem : the error undefined reference to `pal_lld_setpad'

Hi Jad, 

use "siul_lld_setpad..."

Thanks,

AutoDevKit Team

Jad
Associate III

unfortunately i have the same error memssge: undefined reference to `siul_lld_setpad' by the way, from where could i get the informations on those functions ?(for now i was just used to copy them from other programs)

Hi Jad, 

pls try this code:

int main(void)
{
/* Initialization of all the imported components in the order specified in
the application wizard. The function is generated automatically.*/
componentsInit();
irqIsrEnable();

for(;;)
{
siul_lld_readpad(PORT_PIN_GPIO36, PIN_GPIO36);rqIsrEnable();

}

}

Thanks,

AutoDevKit Team

Jad
Associate III

this time the message error is undefined reference to `rqIsrEnable'. would you know where i could get informations on this functions so i understand if there is mising librarys that i should include?

ATROI
ST Employee

Hi Jad,

 

in my copy and paste there was an error.

Pls replace the line:

siul_lld_readpad(PORT_PIN_GPIO36, PIN_GPIO36);rqIsrEnable();

with 

siul_lld_readpad(PORT_PIN_GPIO36, PIN_GPIO36);

now it should work.

Thanks,

AutoDevKit Team

P.S.

if you open the welcome page in AutoDevKit, see the image below, you can find the same tutorial that can help.

ATROI_0-1725639132726.png