vancegroup-mirrors / avr-libc

Automated svn2git mirror of avr-libc - link goes to upstream
98 stars 200 forks source link

Assembly build error #5

Closed SilversRayleigh98 closed 11 months ago

SilversRayleigh98 commented 11 months ago

Hello, i'm trying to use this library with an stm32f4 instead of arduino, i've added this library to my project and been having trouble building the code as there seems to be an issue with the compiler (i'm using GCC compiler), it keeps provoking (error: impossible constraint in 'asm'), please help me, and thanks in advance ! down below i'll add a screenshot of the problem: help

rpavlik commented 11 months ago

AVR-libc is just the C library implementation for the Atmel AVR architecture. It will never work on an stm32f4, you'll need to use a libc compatible with that platform (often newlib). The reason it can't build the assembly is because it's AVR assembly, which is not the same as ARM assembly.

I'm not sure why you're trying to use this library: when it's used with an Atmel powered Arduino it's usually implicit. (And this is just an old git mirror of svn before upstream presumably moved to git...). My best guess is based on the header whose error you're showing: you're trying to build some code written for AVR on arm. But you won't need program memory defines on an stm32, it's not a Harvard architecture with split code and data buses. Should just be able to mark stuff as const. On AVR there is a different assembly mnemonic for "load from program memory" than "load from data memory" and proper separate memory space support took a really long time to arrive in GCC, so there's lots of AVR code out there still using these old macros.