Giter Site home page Giter Site logo

bare_metal_stm32f401xe's People

Contributors

christianrinn avatar prof7bit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bare_metal_stm32f401xe's Issues

Blink not work

Hi, I am on arch linux and I have a Nucleo STM32F401RE

The compilation work and transfert too.
What is the difference with stm32f401xe and stm32f401re?

Thanks

make install

[CC] src/main.c:
arm-none-eabi-gcc -MMD -c -o build/src/main.o -Isrc/STM32F401XE -ffunction-sections -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu11 -ggdb -Os -flto -Wall -Wextra -Wstrict-prototypes -Werror -Wno-error=unused-function -Wno-error=unused-variable -Wfatal-errors -Warray-bounds -Wno-unused-parameter src/main.c

[LD] build/hello_world.elf:
arm-none-eabi-gcc -o build/hello_world.elf build/src/STM32F401XE/gcc_startup_system.o build/src/main.o -ffunction-sections -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=gnu11 -ggdb -Os -flto --specs=nano.specs --specs=nosys.specs -nostartfiles -Wl,--gc-sections -Tsrc/STM32F401XE/gcc_linker.ld -lm -Wl,-Map=build/hello_world.map

[objcopy] build/hello_world.hex:
arm-none-eabi-objcopy -O ihex -S build/hello_world.elf build/hello_world.hex

[OpenOCD] program build/hello_world.hex:
openocd -d0
-f board/st_nucleo_f4.cfg
-c "program build/hello_world.hex"
-c "reset run"
-c "shutdown"
Open On-Chip Debugger 0.9.0 (2016-04-27-23:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001bc msp: 0x20018000
** Programming Started **
auto erase enabled
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20018000
wrote 16384 bytes from file build/hello_world.hex in 0.687820s (23.262 KiB/s)
** Programming Finished **
shutdown command invoked

Project has unclear licensing

Hello,

I'd love to use this project as a base for my development. You clearly put work into doing a clean implementation to keep licensing issues to a minimum, but you have not declared any license for the code you have written. Could you add a comment stating what license the code is under?

Thanks!

Calling main from a function pointer fails with GCC 6

Hi,

I tried to compile and run the bare metal example which I adopted to the Nucleo F411 with GCC 6.3.0 and landed in the default handler instead of main, while everything works perfectly fine with GCC 4.9.3. It simply crashes when calling __main__(); .
Changing the call of the main function to a simple main(); and marking the function with __attribute__((noinline)) did the trick, keeping it non-inlined. Interestingly I only got it to compile as a release build (with -0s and -flto) because a make DEBUG=1 leads to the following error.

src/STM32F411XE/gcc_startup_system.c: In function 'Reset_Handler': src/STM32F411XE/gcc_startup_system.c:197:20: error: cannot allocate stack for variable '__main__', naked function. int(* volatile __main__)(void) = main;

I wonder why the compiler does not complain for a release build but instead generates complete bogus, e.g. ldr R3, [sp, #4] which should point somewhere beyond the end of RAM (see screenshot below). The value of the __main__ pointer also seems way off.

screenshot_20170401

This is probably the same issue that lead to #2 because he is also using Arch Linux and probably had GCC 6 installed.

Anyhow I do not really understand why one should worry about the compiler inling the main function at all. Can you give me a hint why I should avoid that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.