Tagged: SAM4E LEDBlink
June 20, 2022 at 06:39 #32765June 20, 2022 at 08:08 #32768
This is by design. It is not viable for us to ship a separate LEDBlink sample for every possible board on the market. It is up to you to review the schematics of your board and select the values that would work.June 20, 2022 at 10:32 #32769
It’s not about matching the schematic, the Wizard allows you to change the pin that gets toggled.
It’s about the proper use of the Atmel Advanced Software Framework (ASF) for SAM Devices. This bug can be fixed by modifying the board support package LED_Blink_SAM sample. If you edit:
And change every instance of:
The resulting binary will compile and run and actually blink the LED on the pin specified by the user in the Embedded Project Wizard.
The Atmel supplied ASF library for GPIO (pio.c and pio.h) has functions whose arguments identifying a specific pin want a pin index as defined by the library. The legal pin index numbers are found in the device specific header file (e.g. sam4e16e.h).
In the original post, the LED is connected to bit 22 on Port D. The Embedded project wizard translated that to PIO_PD22. While there is a definition in the device specific header for PIO_PD22 it is NOT the ASF index for that pin. In fact it is the same value as PIO_PA22 and PIO_PC22 so it is not a unique value, and not the value the ASF is expecting, but it will successfully compile with that value, it will not run.
So, if, in a subsequent release of VisualGDB’s Atmel ARM Cortex Devices board support package the sample LEDBlink.c file was changed, future customers will only have to worry about getting the correct pin and not then having to figure out why it still won’t blink the LED.
Attachments:You must be logged in to view attached files.
You must be logged in to reply to this topic.