2017-01-16 11:36 PM
Hello everyone,
I started new project that consist of ds2401 and stm32f030f4.I use Cubemx and hal drivers for this project.
Basically ? just would like to use onewire communication to read data from this ID chip.Therefore I tried to add TM drivers from this webside and this library is used for stm32f4 series.I just wanted to migrate it for f0 series but unfortunately ? was not able to add this libraries.
Is there anyway to make them work in my microcontroller.
Here is an example for onewire connection and the libarary is available below of this page :
https://stm32f4-discovery.net/2014/05/library-12-onewire-library-for-stm43f4xx/
here is my projectview
On the left side I added TM drivers , But after build I get following errors;
../Drivers/STM32F0xx_HAL_Driver/Inc/tm_stm32_delay.h(185): error: &sharp20: identifier ''DWT'' is undefined
uint32_t start = DWT->CYCCNT;..\Drivers\STM32F0xx_HAL_Driver\Src\tm_stm32_delay.c(47): error: &sharp20: identifier ''CoreDebug'' is undefined CoreDebug->DEMCR &= ~0x01000000;..\Drivers\STM32F0xx_HAL_Driver\Src\tm_stm32_delay.c(51): error: &sharp20: identifier ''DWT'' is undefined#onewire #ds2401 #stm32f030f4 #hal-drivers2017-01-17 02:04 AM
It seem the library uses the DWT counter for delays. F0 does not implement the DWT, so you need another way to implement the One-Wire primitives. Using the Usart is one way to go.
2017-01-17 05:27 AM
Hello
ohayo.John
,You can take as reference this
, it help youto determine differences between the two seriesandanalyze the steps you need to migrate,
withgive attention to the peripheralcompatibility.
You have a list of 'Getting started with STM32F0' documents that may help you to start your project.
Also, you
may start from the template project in the STM32CubeF0 firmware package and then add your own modifications.
Regards
Imen
2017-01-17 07:36 AM
I'd recommend benchmarking a spin loop, in the form
volatile int i = 10000;
while(i--);
2017-02-02 01:03 AM
Unfortunately there is no migration application between f0 and f4 series.I still have same error.
Is there any Onewire library available for stm32f0 series?
2017-02-02 07:16 AM
You have one timing routine to fix, is there a reason you can't just fix that?
Calibrate a loop, or use a free-running TIM