AnsweredAssumed Answered

Keil µVision5 - NUCLEO STM32F334R8 - Running the GPIO Toggle code

Question asked by Antoine.PM on Jun 21, 2016
Latest reply on Jun 23, 2016 by Antoine.PM
Hi,

still completely stuck with my waveform generation on my NUCLEO-F334R8, I thought it could be a food thing to start from the beginning, with a more simple code.

So I tried GPIO Toggle example from the standard libraries.

I understand that I'm supposed to observe a signal on the scope, then nothing, then signal again, etc.

There is no GPIOE on F334R8, so I changed it to GPIOC. This is the only change I made.
01.#include "stm32f30x.h"
02. 
03./* Private define ------------------------------------------------------------*/
04.#define BSRR_VAL 0xC000
05./* Private variables ---------------------------------------------------------*/
06.GPIO_InitTypeDef        GPIO_InitStructure;
07. 
08.int main(void)
09.{
10.  
11. /* GPIOC Periph clock enable */
12.  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);
13.   
14.  /* Configure PC14 and PC15 in output pushpull mode */
15.  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15 | GPIO_Pin_14;
16.  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
17.  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
18.  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
19.  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
20.  GPIO_Init(GPIOC, &GPIO_InitStructure);
21.   
22.  
23.  while (1)
24.  {
25.    /* Set PC14 and PC15 */
26.    GPIOC->BSRR = BSRR_VAL;
27.    /* Reset PC14 and PC15 */
28.    GPIOC->BRR = BSRR_VAL;
29.     
30.    /* Set PC14 and PC15 */
31.    GPIOC->BSRR = BSRR_VAL;
32.    /* Reset PC14 and PC15 */
33.    GPIOC->BRR = BSRR_VAL;
34.     
35.    /* Set PC14 and PC15 */
36.    GPIOC->BSRR = BSRR_VAL;
37.    /* Reset PC14 and PC15 */
38.    GPIOC->BRR = BSRR_VAL;
39.     
40.    /* Set PC14 and PC15 */
41.    GPIOC->BSRR = BSRR_VAL;
42.    /* Reset PC14 and PC15 */
43.    GPIOC->BRR = BSRR_VAL;
44.     
45.    /* Set PC14 and PC15 */
46.    GPIOC->BSRR = BSRR_VAL;
47.    /* Reset PC14 and PC15 */
48.    GPIOC->BRR = BSRR_VAL;
49.     
50.    /* Set PC14 and PC15 */
51.    GPIOC->BSRR = BSRR_VAL;
52.    /* Reset PC14 and PC15 */
53.    GPIOC->BRR = BSRR_VAL;
54.     
55.    /* Set PC14 and PC15*/
56.    GPIOC->BSRR = BSRR_VAL;
57.    /* Reset PC14 and PC15 */
58.    GPIOC->BRR = BSRR_VAL;
59.     
60.    /* Set PC14 and PC15 */
61.    GPIOC->BSRR = BSRR_VAL;
62.    /* Reset PC14 and PC15 */
63.    GPIOC->BRR = BSRR_VAL;
64.     
65.    /* Set PC14 and PC15 */
66.    GPIOC->BSRR = BSRR_VAL;
67.    /* Reset PC0 and PC1 */
68.    GPIOC->BRR = BSRR_VAL;
69.     
70.    /* Set PC14 and PC15 */
71.    GPIOC->BSRR = BSRR_VAL;
72.    /* Reset PC14 and PC15 */
73.    GPIOC->BRR = BSRR_VAL;
74.  }
75.}
 And i still have the orange LED1 that indicates the running has failed.

I think the problem is deeper than just related to the code I'm trying to execute, it might have something to do with the manner I'm trying to execute it, I don't know, but I think if I could run this code (or a blinky, which I don't have as example), I could progress.

Thank you.

Outcomes