Page 2 of 6

Re: STM32F030C8T6 Clock Issue

Posted: Tue Oct 06, 2015 1:33 pm
by Tabulous
Giovanni wrote:I will assess and implement the changes however I will have to leave tests to you.

Giovanni


This is ok :-)

Re: STM32F030C8T6 Clock Issue

Posted: Wed Oct 14, 2015 4:47 pm
by Tabulous
Hi Giovanni
did anything happen on this ?

Tabulous wrote:
Giovanni wrote:I will assess and implement the changes however I will have to leave tests to you.

Giovanni


This is ok :-)

Re: STM32F030C8T6 Clock Issue

Posted: Wed Oct 14, 2015 5:34 pm
by Giovanni
Weekend probably.

Giovanni

Re: STM32F030C8T6 Clock Issue

Posted: Wed Oct 14, 2015 6:03 pm
by Tabulous
ive just pulled the latest down and i see you have added support for F030xC.

I've just tried this, there are some issues when building.

i.e. on F030xC USART3 there is no LIN, but the driver assumes all have LIN thus this creates a build error

Also the debuggiung does not work, its like the clock setup on F030xC is incorrect.

Re: STM32F030C8T6 Clock Issue

Posted: Thu Oct 15, 2015 1:26 pm
by Giovanni
I added support for USART3..6 on F0.

Code: Select all

- HAL: Now STM32 USARTv2 driver initializes the ISR vectors statically on
       initialization. Disabling them was not necessary and added to
       the code size.
- HAL: Added serial driver support for USART 3..6 on STM32F030xC devices.


I had to modify the ISR initialization moving it into the init() function, this saved some code in the driver. If the change proves to not bring problems then I will extend it to the other drivers.

Giovanni

Re: STM32F030C8T6 Clock Issue

Posted: Thu Oct 15, 2015 4:23 pm
by Tabulous
Giovanni wrote:I added support for USART3..6 on F0.

Code: Select all

- HAL: Now STM32 USARTv2 driver initializes the ISR vectors statically on
       initialization. Disabling them was not necessary and added to
       the code size.
- HAL: Added serial driver support for USART 3..6 on STM32F030xC devices.


I had to modify the ISR initialization moving it into the init() function, this saved some code in the driver. If the change proves to not bring problems then I will extend it to the other drivers.

Giovanni


You have defined things twice how comes USART6 is using USART3 DMA ???

#define STM32_HAS_USART6 TRUE
#define STM32_USART3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
STM32_DMA_STREAM_ID_MSK(1, 3) |\
STM32_DMA_STREAM_ID_MSK(1, 5))
#define STM32_USART3_RX_DMA_CHN 0x000D0D0D
#define STM32_USART3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
STM32_DMA_STREAM_ID_MSK(1, 4))
#define STM32_USART3_TX_DMA_CHN 0x0000D0D0

Re: STM32F030C8T6 Clock Issue

Posted: Thu Oct 15, 2015 4:41 pm
by Giovanni
Cut and paste.

Giovanni

Re: STM32F030C8T6 Clock Issue

Posted: Sat Oct 17, 2015 10:56 am
by Giovanni
I think the change to the clock tree for F030xC and F070 will take a while.

Giovanni

Re: STM32F030C8T6 Clock Issue

Posted: Sat Oct 17, 2015 11:29 am
by Giovanni
Tabulous wrote:
Giovanni wrote:There must be some differences in RCC or clock tree.

Probably it is something simple but I don't have any HW for a debug session.

Giovanni


This is correct, the F0's have two different clock trees, this can be seen on the reference manual page 90/91

http://www.st.com/st-web-ui/static/acti ... 091010.pdf

if the device is Clock tree (STM32F030x4, STM32F030x6 and STM32F030x8 devices)
then the HSI has a fixed divide by 2, then PLL Mull x 12 to get 48Mhz

if the device is Clock tree (STM32F070x6, STM32F070xB and STM32F030xC)
then the HSI is divide by a selectable PREDIV, then PLL Mull to get 48Mhz


This is really hard to decide, see the documentation of PLLSRC about F0xx devices (RM0091), it says that PREDIV is forced to divide by 2 when HSI/2 is selected of those devices without the HSI:2 divider, it is like they are made SW-compatible with an HW trick.

I wonder if this is the same for 030/070 devices (RM0360), the thing is not mentioned but it could be done in the same way.

If this is true then the current code should work as-is. Could you verify? I have no devices with the 2nd clock tree.

Giovanni

Re: STM32F030C8T6 Clock Issue

Posted: Tue Nov 17, 2015 3:59 pm
by Tabulous
Giovanni wrote:
Tabulous wrote:
Giovanni wrote:There must be some differences in RCC or clock tree.

Probably it is something simple but I don't have any HW for a debug session.

Giovanni


This is correct, the F0's have two different clock trees, this can be seen on the reference manual page 90/91

http://www.st.com/st-web-ui/static/acti ... 091010.pdf

if the device is Clock tree (STM32F030x4, STM32F030x6 and STM32F030x8 devices)
then the HSI has a fixed divide by 2, then PLL Mull x 12 to get 48Mhz

if the device is Clock tree (STM32F070x6, STM32F070xB and STM32F030xC)
then the HSI is divide by a selectable PREDIV, then PLL Mull to get 48Mhz


This is really hard to decide, see the documentation of PLLSRC about F0xx devices (RM0091), it says that PREDIV is forced to divide by 2 when HSI/2 is selected of those devices without the HSI:2 divider, it is like they are made SW-compatible with an HW trick.

I wonder if this is the same for 030/070 devices (RM0360), the thing is not mentioned but it could be done in the same way.

If this is true then the current code should work as-is. Could you verify? I have no devices with the 2nd clock tree.

Giovanni


Sorry for the delay on this, just tried to enable PLL on a STM32F030CCT6 and it wont work, the device just keeps resetting

What board / processor did you create and test the port on ?