-
1The easy way to configure the cross-compilation environment
Well, you all know the version 1.0 of the board have some glitches. But it still can boot from UART port, even without the Arduino board. Unfortunately, my USB<->Serial converter uses 5V and I will not risk to fry the board.
So, while the other converter are in transit, we will configure the development ambient. Shall we begin?
We will use Eclipse IDE. I know, I know... "Eclipse? Really?". Unfortunately, yes. But, looking for the bright side, we always can use the command line.
I assume you are using Windows, but for the Linux guys, the process is almost the same.
Download the Eclipse version LUNA. The Blackfin GNU Toolchain plugin is a little bit old and I could not put it to work with a more recent version.
The 64 bit version is available at: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/RC1/eclipse-cpp-luna-RC1-win32-x86_64.zip
Install it.
Now, we will download the Blackfin Toolchain, but Eclipse will do the hardwork. Open Eclipse and click in Help/Install New Software.
Add the following address: https://sourceforge.net/projects/adi-toolchain/files/eclipse/update_site/
Select both "Blackfin Debug" and "Blackfin GNU Toolchain". In the picture, they are already installed.
Eclipse will download and install it.
-
2The first program
To create and build our first program (or the following ones), there are simple steps to perform:
* In Eclipse IDE, go to "File" / "New" / "C Project".
* Select "Executable" / "Empty Project" / "Blackfin Bare Metal GNU Toolchain (bfin-elf)".
* Choose a project name. "Blink LED", for example.
* "Next". "Next".
* Chose the processor. In our case, the BF592. In the "Silicon Revision", try "any".
* "Finish".
* Add a "C Source file" and write some code. To test our LED:
/* * main.c * * Created on: 22/12/2018 * Author: marcellus */ #include <cdefBF592-A.h> #include <defBF59x_base.h> void main(void){ int i, n; while(1){ //Zera pino PF10 *pPORTFIO_CLEAR = PF10; for(i=0; i<900000; i++){ {asm("NOP;");} } //Seta pino PF10 *pPORTFIO_SET = PF10; for(i=0; i<900000; i++){ {asm("NOP;");} } } }
* Before the build, open the "Properties" panel, right-clicking over the project name. Em "Settings" / "Build Steps", write the following sentence, under the "Post-build steps":
bfin-elf-ldr -T BF592 blinky.ldr blinky --bmode uart
That's it. You can try to compile it now.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.