- Posts: 4402
newlib (stdc) + uart + petit_fat integration
- PhracturedBlue
- Offline
If you haven't noticed, petit_fat doesn't let you resize the filesize. I cheat by zeroing the last 12bits (which is legal because I inverted the filesystem in spi_flash, so I can write 000 to the flash FAT record and it results in a 4095byte file.
since all bytes are guaranteed to read as '0' that haven't been written, ini.c will stop on the 1st one.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I've tried building manually as well as pre-compiled, and have run into various issues.
I'm now trying a full build of the current summon-arm-toolchain (I previously followed the directions here: www.microbuilder.eu/Tutorials/SoftwareDe...ingGCCToolchain.aspx , but it doesn't have the necessary patches to work properly). Unfortunately compiling on mingw is extremely slow, and it takes something like 10 hours to build through the whole toolchain. Hopefully this time it will work
Edit: oops, I meant Windows
Please Log in or Create an account to join the conversation.
- FDR
- Offline
At home on my Vista the compilation is quite slow, however on the XP at work is acceptable...
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Topic Author
- Offline
- Posts: 83
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Topic Author
- Offline
- Posts: 83
Compiling with optimizer also results in a bunch of uninitialized values warnings.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
well, ideally, I want a 'summon' built toolchain. There are several patches to gcc that we want (removal of unwind code for instance). I tried a frankenstein approach of mixing my summon libgcc.a with a pre-built gcc, but the build didn't actually work on the Tx. Yagarto has not been kept up to date as far as I know. I tried using it once (on linux) and was unable to compile libopencm3 for instance.
I may try cygwin. I believe it doesn't pay as much fork penalty as mingw does (though it is slower in many other situations)
I already use a virtualbox setup myself on my Windows machine to boot an Ubuntu image. I may get to the point where that is what FDR needs to use to build, but I'm going to try building the summon toolchain one more time 1st.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Topic Author
- Offline
- Posts: 83
-O3 is a killer, though, that will inline a lot of functions in my experience and create HUGE code.
The optimized version crashes pretty early on, no UART output at all.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
The current code compiles:
118kB -Os
131kB -O1
126kB -O2
156KB -O3
So it isn't like we are in trouble space-wise yet
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Topic Author
- Offline
- Posts: 83
Global variables that are modified in an interrupt should always be declared volatile! I did this for Channels[] in an earlier version today, but there's also the tick timer msecs.
volatile makes sure that the value is actually read on memory when you use the variable, so the optimizer doesn't assume that the variable never changes.
This
/* wait for system to start up and stabilize */
while(msecs < 100)
;
is an endless loop with -O2/-O3, unless msecs is declared volatile.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Channels[] shouldn't be modified in an interrupt and should not need that change.wuselfuzz wrote: Found the issue with the optimizer.
Global variables that are modified in an interrupt should always be declared volatile! I did this for Channels[] in an earlier version today, but there's also the tick timer msecs.
msecs certainly does need it.
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Topic Author
- Offline
- Posts: 83
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
only variables that are written in the interrupt and read from the main code need this flag.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Yep, I know, but they talked about some 90 minutes in the linked doc...PhracturedBlue wrote: 10hrs is for the build building binutils/gcc/newlib, not deviation.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
You can supply one time to time...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
If you run into problems, you can download a ready-to go toolchain here (just unzip it into C:\mingw)
deviationtx.com/downloads/stm32.zip
I'm not sure how much spce we have, so if that 50MB file is too big, feel free to remove it. I also put it on a freebie site here:
www.filedropper.com/stm32
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Is it because of the PREFIX in the makefile?
FDR@FDR-PC ~/src/libopencm3
$ make
BUILD lib/stm32/f1
CC vector.o
make[1]: arm-none-eabi-gcc: Command not found
make[1]: *** [vector.o] Error 127
make: *** [lib] Error 2
...or my path to the stm32 is not valid?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
your path isn't right.FDR wrote: Can't make the libopencm3.
Is it because of the PREFIX in the makefile?
FDR@FDR-PC ~/src/libopencm3 $ make BUILD lib/stm32/f1 CC vector.o make[1]: arm-none-eabi-gcc: Command not found make[1]: *** [vector.o] Error 127 make: *** [lib] Error 2
...or my path to the stm32 is not valid?
if you set your path in .profile, you need to restart your terminal.
otherwise, something else is wrong with it. what does 'echo $PATH' show?
I just noticed my instructions are wrong. it should be:
export PATH=/mingw/stm32/bin:$PATH
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Topic Author
- Offline
- Posts: 83
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Yep, I've found that too. Please correct the instructions for the rest who will try...PhracturedBlue wrote:
your path isn't right.FDR wrote: ...or my path to the stm32 is not valid?
if you set your path in .profile, you need to restart your terminal.
otherwise, something else is wrong with it. what does 'echo $PATH' show?
I just noticed my instructions are wrong. it should be:export PATH=/mingw/stm32/bin:$PATH
The compile succeeded (however with quite a few warnings), and I could build the dfu. Looks valid, but I can try it only later at home...
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- newlib (stdc) + uart + petit_fat integration