Author Topic: stm32f417 clock hse bypass  (Read 4728 times)

0 Members and 1 Guest are viewing this topic.

Offline kodyTopic starter

  • Contributor
  • Posts: 34
  • Country: ca
stm32f417 clock hse bypass
« on: October 26, 2014, 07:23:21 pm »
Hi,

I am looking to receive some info regarding the external clock bypass conditions for STM32F417IG. There was not sufficient info in the datasheet. But, in the reference manual I could find some related data regarding how it can be done.
Another problem was the Clock Config tool does not support the external clock bypass conditions. So, that was a handicap in generating the required C code to dump.

I just wanted to confirm from you if the following changes in the system_stm32f4xx.h header file would be sufficient to use the chip in bypass conditions by feeding it using an external single ended clock source and have it communicating with the computer with VCP:

I set the  macro to pll_source_hse_bypass.
and
 RCC->CR |= ((uint32_t)(RCC_CR_HSEON | RCC_CR_HSEBYP));

  RCC->CR |= ((uint32_t)RCC_CR_HSEON);

In the main.c:
I have the following config-
#define HSE_VALUE((uint 32_t)8000000)
should I leave it as it is or make any changes to this in main?

I request you to please provide any other samples/code/reference design if available about the same conditions.

I already tried with the modifications mentioned above and I think I partially bricked one of the device. I am able to program the flash but it is not able to communicate with pc as the VCP is not being detected.


I thereby request you to please look into this and provide some solutuon.


Thanks,
Kody
« Last Edit: October 26, 2014, 07:30:42 pm by kody »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: stm32f417 clock hse bypass
« Reply #1 on: October 26, 2014, 11:05:32 pm »
Take a look at the library function that configures HSE - one of the options is the bypass. It is very simple.

Your issues, however, sounds like something else - you seem to have configured the mcu to use an external clock without actually providing one.

Without knowing more about your set-up, it is hard to help you more.
================================
https://dannyelectronics.wordpress.com/
 

Offline kodyTopic starter

  • Contributor
  • Posts: 34
  • Country: ca
Re: stm32f417 clock hse bypass
« Reply #2 on: October 27, 2014, 12:22:33 am »
hi dannyf, Thanks for reply.

My setup is -
For the hardware modifications:
I am looking at using an external single ended clock source. So this would mean cutting the existing path and driving the externally generated singel ended high freq clock into the pin 29(GPIO PH0) which is osc_in and leaving the osc_out at high impedance.

For software changes:
I will set the hseon and hsebyp flags in the system_stm32f4xx.c file. Please let me know if there should be any other changes.


My confusion is what other software changes are necessary to have the external bypass the pll and control the chip and peripherals.
Also, if I should change it in here :
/* Select the main PLL as system clock source */
RCC -> CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
RCC -> CFGR |= RCC_CFGR_SW_PLL;


 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: stm32f417 clock hse bypass
« Reply #3 on: October 27, 2014, 12:47:03 am »
I would suggest, again, that you take a look at the HSE configuration calls in the library if you want to see how to set up the registers to use external clock sources.

Your problem, however, is not that: once the chip is in reset, it defaults to the internal oscillators so you should be able to communicate with the chip regardless of its hse configuration.

Get your chip to blink an led and then come back for more.
================================
https://dannyelectronics.wordpress.com/
 

Offline kodyTopic starter

  • Contributor
  • Posts: 34
  • Country: ca
Re: stm32f417 clock hse bypass
« Reply #4 on: October 27, 2014, 01:08:41 am »
I have actually tried it already with few register settings mentioned according to the hse config calls. But, the VCP stopped being detected. That is the problem.

As you said the chip defaults to internal oscillators on reset. Could you please tell what register setting has to be retained for this to happen?
 

Offline kodyTopic starter

  • Contributor
  • Posts: 34
  • Country: ca
Re: stm32f417 clock hse bypass
« Reply #5 on: October 30, 2014, 04:55:44 pm »
danny,

I programmed the stm with the required pll values and hse flags. It is not being recognized in usb when i power it up with the hse clock input.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: stm32f417 clock hse bypass
« Reply #6 on: October 30, 2014, 07:01:07 pm »
I want to let you know that I really want to help you. I do.

However, I don't think you are doing yourself any favor by refusing to provide better information and to go back to basic.

There is a significant information asymmetry here: you know your setup intimately and we don't. What's a given to you is completely unknown to the rest of us. If you cannot help others understand your issues, no one can help you addressing them.

So, as I suggested earlier, start with something as simple as possible (like blinking an led). Once you have established that, we can go from there.

Hope it help.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf