2x1=10

because numbers are people, too
Persönliches
Fotografie
Programmierung
    • STM32F3-Discovery: no 72 MHz clock due to HSE never ready

      Now what a fun: Unboxed my brand new STM32F3-Dis­cov­ery, plugged it in — sweet blink­ing rap­ture. Com­piled my first demo pro­gram, played around with the timers, all was so good. Until I had a clos­er look at the sys­tem clock speed: 8 MHz it said. So I dug into the unknown grounds of STM32F3 devel­op­ment, end­ed up in the gen­er­at­ed firmware’s sys­tem ini­tial­iza­tion func­tion in system_stm32f30x.c — which looks like this:

      static void SetSysClock(void)
      {
          __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
      
          /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------*/
          /* Enable HSE */
          RCC->CR |= ((uint32_t)RCC_CR_HSEON);
      
          /* Wait till HSE is ready and if Time out is reached exit */
          do
          {
              HSEStatus = RCC->CR & RCC_CR_HSERDY;
              StartUpCounter++;
          } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
      
          if ((RCC->CR & RCC_CR_HSERDY) != RESET)
          {
              HSEStatus = (uint32_t)0x01; // all good
          }
          else
          {
              HSEStatus = (uint32_t)0x00; // nah.
          }
      
          /* ... */
      

      I did so, only to find out that HSEStatus nev­er switched to 0x01 because the RCC_CR_HSERDY flag was nev­er assert­ed in the first place.

      Obvi­ous­ly no one else in the whole wide web had trou­ble with this. Cold water? Let’s dive!
      Some dude at the ST forums point­ed me to the trick to out­put the RCC clock sig­nal to the board’s PA8 pin, which I did like so:

      void InitializeMCOGPIO() {
          RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
      
          /* Configure MCO (PA8) */
          GPIO_InitTypeDef gpioStructure;
          gpioStructure.GPIO_Pin = GPIO_Pin_8;
          gpioStructure.GPIO_Speed = GPIO_Speed_50MHz;
          gpioStructure.GPIO_Mode = GPIO_Mode_AF;
          gpioStructure.GPIO_OType = GPIO_OType_PP;
          gpioStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
          GPIO_Init(GPIOA, &gpioStructure);
      
          /* Output HSE clock on MCO pin (PA8) */
          RCC_MCOConfig(RCC_MCOSource_HSE);
      }
      

      Turned out … well, noth­ing. Flat­line on that pin. So I took my mul­ti­me­ter and went upstream from the oscil­la­tor pins. Sol­der bridge SB12, of course bridged, work­ing fine, SB17 open as request­ed, and then — silence on RB48. No beeps on my meter, no val­ue, just plain high imped­ance.

      To make a long sto­ry short: That 100 Ω resis­tor was borked, so I replaced it with some spare parts of an old scan­ner board I had float­ing around in the to-do stash. I’m not exact­ly known for mas­sive sol­der­ing expe­ri­ence, but this video helped a lot here.

      Final result:

      STM32F3-Discovery RB48 replaced

      Ugly but effec­tive. Works like a charm now.

      Februar 21st, 2015 GMT +1 von
      Markus
      2015-02-21T19:09:06+01:00 2015-02-21T19:09:06+01:00 · 0 Kommentare
      STM32F3 STM32F3-Discovery SMD soldering
      Embedded

      Hinterlasse einen Kommentar

      Hier klicken, um das Antworten abzubrechen.

    1. « newer
    2. 1
    3. …
    4. 11
    5. 12
    6. 13
    7. 14
    8. 15
    9. 16
    10. 17
    11. …
    12. 43
    13. older »
    • Kategorien

      • .NET
        • ASP.NET
        • Core
        • DNX
      • Allgemein
      • Android
      • Data Science
      • Embedded
      • FPGA
      • Humor
      • Image Processing
      • Kalman Filter
      • Machine Learning
        • Caffe
        • Hidden Markov Models
        • ML Summarized
        • Neural Networks
        • TensorFlow
      • Mapping
      • MATLAB
      • Robotik
      • Rust
      • Signal Processing
      • Tutorial
      • Version Control
    • Neueste Beiträge

      • Summarized: The E-Dimension — Why Machine Learning Doesn’t Work Well for Some Problems?
      • Use your conda environment in Jupyter Notebooks
      • Building OpenCV for Anaconda Python 3
      • Using TensorFlow’s Supervisor with TensorBoard summary groups
      • Getting an image into and out of TensorFlow
    • Kategorien

      .NET Allgemein Android ASP.NET Caffe Core Data Science DNX Embedded FPGA Hidden Markov Models Humor Image Processing Kalman Filter Machine Learning Mapping MATLAB ML Summarized Neural Networks Robotik Rust Signal Processing TensorFlow Tutorial Version Control
    • Tags

      .NET Accelerometer Anaconda Bitmap Bug Canvas CLR docker FPGA FRDM-KL25Z FRDM-KL26Z Freescale git Gyroscope Integration Drift Intent J-Link Linear Programming Linux Magnetometer Matlab Mono Naismith OpenCV Open Intents OpenSDA Optimization Pipistrello Player/Stage PWM Python Sensor Fusion Simulink Spartan 6 svn tensorflow Tilt Compensation TRIAD ubuntu Windows Xilinx Xilinx SDK ZedBoard ZYBO Zynq
    • Letzte Kommetare

      • Lecke Mio bei Frequency-variable PWM generator in Simulink
      • Vaibhav bei Use your conda environment in Jupyter Notebooks
      • newbee bei Frequency-variable PWM generator in Simulink
      • Markus bei Using TensorFlow’s Supervisor with TensorBoard summary groups
      • Toke bei Using TensorFlow’s Supervisor with TensorBoard summary groups
    • Blog durchsuchen

    • Februar 2015
      M D M D F S S
      « Sep   Mrz »
       1
      2345678
      9101112131415
      16171819202122
      232425262728  
    • Self

      • Find me on GitHub
      • Google+
      • Me on Stack­Ex­change
      • Ye olde blog
    • Meta

      • Anmelden
      • Beitrags-Feed (RSS)
      • Kommentare als RSS
      • WordPress.org
    (Generiert in 0,827 Sekunden)

    Zurück nach oben.