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


How To Use DAC on STM32F4 Discovery?

The code generated by the CubeMX will have
HAL_Init();
at the beginning
and also I do not know about “pininit”

Anyway try this example or upload the complete code with cube file
to test it

/*##-1- Initialize the DAC peripheral ######################################*/
if(HAL_DAC_Init(&DacHandle) != HAL_OK)
{
/* Initialization Error */
}

/*##-2- DAC channel2 Configuration #########################################*/
sConfig.DAC_Trigger = DAC_TRIGGER_T6_TRGO;
sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE;

if(HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DACx_CHANNEL1) != HAL_OK)
{
/* Channel configuration Error */
}

/*##-3- DAC channel2 Triangle Wave generation configuration ################*/
if(HAL_DACEx_TriangleWaveGenerate(&DacHandle, DACx_CHANNEL1, DAC_TRIANGLEAMPLITUDE_1023) != HAL_OK)
{
/* Triangle wave generation Error */
}

/*##-4- Enable DAC Channel1 ################################################*/
if(HAL_DAC_Start(&DacHandle, DACx_CHANNEL1) != HAL_OK)
{
/* Start Error */
}

/*##-5- Set DAC channel1 DHR12RD register ################################################*/
if(HAL_DAC_SetValue(&DacHandle, DACx_CHANNEL1, DAC_ALIGN_12B_R, 0x100) != HAL_OK)
{
/* Setting value Error */
}



Best regards
Eng.Mazen