2024-09-06 06:09 AM
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
Solved! Go to Solution.
2024-09-06 09:14 AM
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.
2024-09-06 06:45 AM
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).
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
2024-09-06 06:52 AM
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
kind regards
2024-09-06 07:00 AM
Hi Jad,
pls. start from scratch, crate new project and follow
the steps I suggested before, it should work.
Thanks,
AutoDevKit Team.
2024-09-06 07:11 AM
thanks, it worked for the pin
2024-09-06 07:13 AM
Hi Jad,
use "siul_lld_setpad..."
Thanks,
AutoDevKit Team
2024-09-06 07:16 AM
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)
2024-09-06 07:27 AM
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
2024-09-06 07:32 AM
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?
2024-09-06 09:14 AM
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.