05.12.2012 Views

How-to manual Installing a toolchain for Cortex-M3/STM32 on Ubuntu

How-to manual Installing a toolchain for Cortex-M3/STM32 on Ubuntu

How-to manual Installing a toolchain for Cortex-M3/STM32 on Ubuntu

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.1.8 Hints<br />

There exists a lot of documentati<strong>on</strong> and hints about Eclipse – and it seems <str<strong>on</strong>g>to</str<strong>on</strong>g> be necessary. This<br />

chapter intends <str<strong>on</strong>g>to</str<strong>on</strong>g> c<strong>on</strong>tain useful know-how about first and standard steps. Hope it's c<strong>on</strong>tent will<br />

increase by time and with successful usage of the IDE.<br />

Debuggen mit GDB (Gnu DeBugger) unter Eclipse :<br />

http://homepages.thm.de/~bbdw58/anleit/debuggen.pdf<br />

Dokumentieren mit Eclipse und Doxygen:<br />

http://homepages.thm.de/~bbdw58/anleit/doxygen.pdf<br />

EGit/User Guide:<br />

http://wiki.eclipse.org/EGit/User_Guide<br />

Git with Eclipse (EGit) - Tu<str<strong>on</strong>g>to</str<strong>on</strong>g>rial<br />

http://www.vogella.de/articles/EGit/article.html<br />

8 Bugs and Workarounds<br />

8.1 GCC <str<strong>on</strong>g>to</str<strong>on</strong>g>olchain<br />

Bug in Newlib C Library (1.18.0-sg++) (stdlib.h) included in “Sourcery CodeBench Lite” – when<br />

including functi<strong>on</strong> “str<str<strong>on</strong>g>to</str<strong>on</strong>g>ull” in program code, communicati<strong>on</strong> via USART switches <str<strong>on</strong>g>to</str<strong>on</strong>g> baudrate x 4,<br />

sometimes HardFault_Handler interrupt occurs. Functi<strong>on</strong> “str<str<strong>on</strong>g>to</str<strong>on</strong>g>ul” seems <str<strong>on</strong>g>to</str<strong>on</strong>g> be not affected.<br />

Workaround:<br />

1. Do not use corrupted functi<strong>on</strong>s from Newlib C Library or do not use this lib at all.<br />

The same effect occurs when adding following c<strong>on</strong>tent <str<strong>on</strong>g>to</str<strong>on</strong>g> the source code:<br />

l<strong>on</strong>g l<strong>on</strong>g test1 = 10, test2 = 4, test3;<br />

test3 = test1 / test2;<br />

As so<strong>on</strong> as the code “divisi<strong>on</strong> of a l<strong>on</strong>g l<strong>on</strong>g variable” exists inside the program (no matter where), the<br />

USART behaves strange. Maybe the above menti<strong>on</strong>ed functi<strong>on</strong> “str<str<strong>on</strong>g>to</str<strong>on</strong>g>ull” c<strong>on</strong>tains a 64-bit divisi<strong>on</strong><br />

<str<strong>on</strong>g>to</str<strong>on</strong>g>o. The <str<strong>on</strong>g>manual</str<strong>on</strong>g> "Using the GNU Compiler Collecti<strong>on</strong>, chapter 6.9" tells that l<strong>on</strong>g l<strong>on</strong>g divisi<strong>on</strong>s are<br />

open coded and are available <strong>on</strong>ly <strong>on</strong> machines 'providing special support'.<br />

Workaround:<br />

1. do not use l<strong>on</strong>g l<strong>on</strong>g divisi<strong>on</strong>.<br />

It would be just of interest how the code of the divisi<strong>on</strong> can alter the program in a way that:<br />

+ everything still works and debug functi<strong>on</strong>ality is fine<br />

+ even the result of the l<strong>on</strong>g l<strong>on</strong>g divisi<strong>on</strong> is OK<br />

- the baudrate changes <str<strong>on</strong>g>to</str<strong>on</strong>g> baudrate x 4 (which is defined by the c<strong>on</strong>tent of a CPU-register, not by the<br />

translated code itself)<br />

8.2 IDE -eclipse<br />

Bug 351549 - IDE shows source has errors, but it builds without errors. Errors in “Problems” terminal<br />

look like: “Type xxx could not be resolved ... Semantic Error”. This error happens <strong>on</strong> “Eclipse<br />

Plat<str<strong>on</strong>g>for</str<strong>on</strong>g>m 3.7.1.r37” with “Eclipse CDT 8.0.0.”. The IDE can come in<str<strong>on</strong>g>to</str<strong>on</strong>g> this (buggy) state, but it must<br />

not – seems <str<strong>on</strong>g>to</str<strong>on</strong>g> be depending <strong>on</strong> making project or workspace settings.<br />

Two workarounds known:<br />

1. Switch code analysis off (recommended): Window → Preferences → C/C++ → Code<br />

Analysis → clear all checkboxes → Apply → OK → delete all errors in “Problems” terminal.<br />

2. Add include path <str<strong>on</strong>g>to</str<strong>on</strong>g> project (not recommended): Project → Properties → C/C++ General →<br />

Paths and Symbols → Includes → GNU C → Add “usr/include” → Apply → OK<br />

Page 35 of 38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!