2013-12-20 12:03 AM
Hello,
I will be making (or trying to make) my own custom board with STM32L152CC (LFP48 package). I have successfully implemented my application on the STM32L152RC Discovery board using: - 3 GPIO pins for PWM - 2 GPIO pins for I2C - 2 GPIO pins for USART - also using the LSE (32.768 kHz) for RTC Time structure to get the current time values from the register and the HSI (16 MHz) clock. Since this is my first time making my own board using the ARM processor, I have some questions regarding this: 1. What determines the AHB, APB1, APB2 clocks (from 0 to 32 MHz)? 2. A silly question probably, but I have some calculations on the chip - how do I know that it uses 32 MHz clock. When I configure the HSI clock (16 MHz), how do I configure the HCLK to be 32MHz? It can be either 16 or 32 MHz according to the datasheet. 3. The chip I will be using comes with a bootloader, so that I should be able to program it via the Rx and Tx lines. How do I configure correctly to enable/disable booting from the bootloader (on which pins do I need to connect the jumper/switch)? Thank you very much for any help. Best regards, K2013-12-20 02:11 AM
Regarding question number 3. - its noted in a different datasheet... I understand now.
2014-01-16 06:29 AM
Hi Klemen,
I hope it is not so late to answer you. You can find all information & application notes related to STM32L152CC on thishttp://www.st.com/web/catalog/mmc/FM141/SC1169/SS1295/LN962/PF253305
. Have mainly a look to the reference manual (RM0038) and the clock configuration tool (http://www.st.com/web/en/catalog/tools/PF257838
) with AN3309. -Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2014-01-16 08:26 AM
You'd want to review the clocking sources, and PLL settings, from an implementation perspective system_stm32L15x.c (or equivalent) would be the place to look to see how the RCC is configured.
2014-01-17 12:09 AM
Thank you very much for your answers.
Actually, I have made some progress since I posted this question, regarding the nature of programming the ARM controllers. Right now, I would probably not ask this question again. I still appreciate the answers though! I have set up the clocks correctly, and removed the external oscillator (since I do not actually need the RT clock) and used TIM to count ms interrupts. The USART is also interrupt based and I have modified the I2C library according to my device datasheet. Everything was tested on the STM32L discovery board. Regarding the loading the chip in bootload mode, the datasheet clearly states the conditions. Best regards, K