blinky demo for STM32F4-Discovery not works on STM32F429I-Discovery
- Dominant language
- C
- Stars
- 891
- Forks
- 381
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
I followed the steps on [Blinky, your “Hello World!”, on STM32F4-Discovery](https://mynewt.apache.org/latest/tutorials/blinky/blinky_stm32f4disc.html).
And every step's result looks fine.
But doesn't work at all, even I try to reset the board.
I also tried to flash the binary directly with command below:
```
st-flash write /Users/linjinhui/Github/mynewt/blinking/bin/targets/stm32f4disc_blinky/app/apps/blinky/blinky.elf.bin 0x8000000
```
But I can blink the leds with mbed demo or STM32Cube via `st-link`.
So the hardware is OK.
And `nucleo-f401re` also works fine with `mynewt` for nucleo-f401re board.
So the compiler is also OK.
Versions:
- Apache Newt version: 1.4.1
- masOS 10.11.6
- Open On-Chip Debugger 0.10.0
- st-flash --version v1.4.0
- arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
Do I skip any important steps?
My `newt target show`: `stm32f429discovery` and `stm32f4discovery` both not work on my STM32F429I-Discovery Board.
```
➜ blinking newt target show
targets/my_blinky_sim
app=apps/blinky
bsp=@apache-mynewt-core/hw/bsp/native
build_profile=debug
targets/nucleo_f401re_blinky
app=apps/blinky
bsp=@apache-mynewt-core/hw/bsp/nucleo-f401re
build_profile=debug
targets/nucleo_f401re_boot
app=@apache-mynewt-core/apps/boot
bsp=@apache-mynewt-core/hw/bsp/nucleo-f401re
build_profile=optimized
targets/stm32f4disc_blinky
app=apps/blinky
bsp=@apache-mynewt-core/hw/bsp/stm32f4discovery
build_profile=debug
targets/stm32f4disc_boot
app=@apache-mynewt-core/apps/boot
bsp=@apache-mynewt-core/hw/bsp/stm32f4discovery
build_profile=optimized
➜ blinking
```
My `main.c` :
```
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include
#include
#include "sysinit/sysinit.h"
#include "os/os.h"
#include "bsp/bsp.h"
#include "hal/hal_gpio.h"
#ifdef ARCH_sim
#include "mcu/mcu_sim.h"
#endif
static volatile int g_task1_loops;
/* For LED toggling */
int g_led_pin;
/**
* main
*
* The main task for the project. This function initializes packages,
* and then blinks the BSP LED in a loop.
*
* @return int NOTE: this function should never return!
*/
int
main(int argc, char **argv)
{
int rc;
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
#endif
sysinit();
// g_led_pin = LED2; // for stm32f429discovery
g_led_pin = LED_BLINK_PIN; // for necleo-f401r1
hal_gpio_init_out(g_led_pin, 1);
while (1)
{
++g_task1_loops;
/* Wait one second */
os_time_delay(OS_TICKS_PER_SEC);
/* Toggle the LED */
hal_gpio_toggle(g_led_pin);
}
assert(0);
return rc;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked STM32F4-Discovery blinky tutorial, the project's main.c, and the stm32f4discovery BSP targets shown in newt target show. Reproduce the flash and reset flow on the STM32F429I-Discovery board, then compare the board's LED pin and BSP configuration with the working nucleo-f401re target. Done means the generated blinky image runs and visibly toggles the expected LED on the STM32F429I-Discovery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100