Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Able to use Debug, but can't upload file to board using Run

Hi all,

I’ve had a lot of success so far after installing System Workbench for simple blinking light programs and such.
I’m currently having trouble getting the program to upload to the board (Nucleo F042). Everything appears to work normally, the LED on the ST Link blinks red/green, but after a few seconds the console shows ** Programming Failed **. It gives the errors:

“error waiting for target flash write algorithm”
“error writing to flash at address 0x08000000 at offset 0x00000000”

but debugging the same exact program using the ‘Debug’ option will work fine and I can view all the registers and variables and step through the program. I can upload this same program to the board using the ST Link Utiltity and everything will work fine. I also checked the board with my oscilloscope and the program is functioning properly (PWM an LED based on ADC value)

Any ideas why I can’t upload to the board from within Workbench?

Thanks in advance

If it makes any difference, this all began when I started working with the ADC Peripherals. In fact, if I comment out the ADC initialization function I created, the program will upload without a problem using Workbench.


Here’s the ADC init function in case it will help any, but I took it almost straight out of ST’s peripheral example:

void InitADC1(void)
{

ADC_InitTypeDef ADC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;

ADC_DeInit(ADC1);

// Enable Clock to ADC
RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);

// GPIOA Peripheral Clock Enable
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);

// Set ADC Clock Speed: Must be < 14 MHz
ADC_ClockModeConfig(ADC1, ADC_ClockMode_AsynClk);

// Configure ADC Channel 4 as Analog Input
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStructure);

// Initialize ADC
ADC_StructInit(&ADC_InitStructure);

ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;
ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None;
ADC_InitStructure.ADC_ExternalTrigConv = 0x00;
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
ADC_Init(ADC1, &ADC_InitStructure);

// Conversion Channel 1 with 239.5 Cycle sampling time
ADC_ChannelConfig(ADC1, ADC_Channel_4, ADC_SampleTime_239_5Cycles);

// ADC Calibration
ADC_GetCalibrationFactor(ADC1);

// Enable ADC Peripheral
ADC_Cmd(ADC1, ENABLE);

// Wait for ADRDY Flag
while(!ADC_GetFlagStatus(ADC1, ADC_FLAG_ADRDY));

// ADC1 Software Start Conversion
ADC_StartOfConversion(ADC1);

}