2023-12-22 05:58 AM
I am trying to dump LED blink program in STM32MP157D-DK1. I don't want to use any other software like STMCubeMX, meaning that, create project in Eclipse and write program to blink LED. I created project and build it successfully, but when run the code, it generates an error " 'Launching Debug' has encountered a problem."
int main(void) {
// Enable GPIO clock for GPIOC
RCC_MC_AHB4ENSETR |= (1U << 2); // Set bit 2 for GPIOCEN
// Set PC0 as output
GPIOC_MODER &= ~(3U << (GPIOC_PIN_0 * 2)); // Clear bits
GPIOC_MODER |= (1U << (GPIOC_PIN_0 * 2)); // Set as output
while (1) {
// Toggle the LED state
GPIOC_ODR ^= (1U << GPIOC_PIN_0); // Toggle PC0
delay(1000000); // Delay
}
return 0;
}
2023-12-22 07:32 AM
Hi @dishas ,
Maybe give more details on your setup. Eclipse is not part of ST recommended development environment and you will miss many required settings and plug-ins.
We recommend to use CubeIDE (which is based on Eclipse).
If you are trying to create a code on Cortex-M4 please have a look on this getting started:
This assume Linux is running on Cortex-A7, this mode is named "production mode" (Code is loaded via Linux via SSH Ethernet or EthernetOverUSB).
If you are using 'Engineering mode" (Code is loaded via JTAG), please have a look to https://wiki.st.com/stm32mpu/wiki/STM32CubeIDE#Engineering_mode. This mode is used during early phase of development of Cortex-M4 FW, but cannot be used on final product as Cortex-M4 FW is loaded by Linux where many initialization are already ensure by Linux Device Tree settings (e.g. root clocks).
Regards.