Skip to content

Commit

Permalink
Update to GCC4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanjm committed Sep 14, 2014
1 parent ba4e058 commit ce6ee09
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 79 deletions.
8 changes: 4 additions & 4 deletions linux_install
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ pushd $ROOTDIR
ROOTDIR=$PWD ROOTDIR=$PWD
LOGFILE=$ROOTDIR/linux_install.log LOGFILE=$ROOTDIR/linux_install.log
ERRORFILE=$ROOTDIR/linux_install.err ERRORFILE=$ROOTDIR/linux_install.err
GCC4ARM_VERSION=gcc-arm-none-eabi-4_7-2012q4 GCC4ARM_VERSION=gcc-arm-none-eabi-4_8-2014q1
GCC4ARM_FILENAME=gcc-arm-none-eabi-4_7-2012q4-20121208-linux.tar.bz2 GCC4ARM_FILENAME=gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2
GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.7/4.7-2012-q4-major/+download/$GCC4ARM_FILENAME GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/$GCC4ARM_FILENAME
GCC4ARM_TAR=$ROOTDIR/$GCC4ARM_FILENAME GCC4ARM_TAR=$ROOTDIR/$GCC4ARM_FILENAME
GCC4ARM_MD5=475c3283253b872bb576020844046cf2 GCC4ARM_MD5=72b0d06ae16b303c25fd70b2883d3950
GCC4ARM_EXTRACT=$ROOTDIR/$GCC4ARM_VERSION GCC4ARM_EXTRACT=$ROOTDIR/$GCC4ARM_VERSION
GCC4ARM_DIR=$ROOTDIR/gcc-arm-none-eabi GCC4ARM_DIR=$ROOTDIR/gcc-arm-none-eabi
GCC4ARM_BINDIR=$GCC4ARM_DIR/bin GCC4ARM_BINDIR=$GCC4ARM_DIR/bin
Expand Down
8 changes: 4 additions & 4 deletions mac_install
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ pushd $ROOTDIR
ROOTDIR=$PWD ROOTDIR=$PWD
LOGFILE=$ROOTDIR/mac_install.log LOGFILE=$ROOTDIR/mac_install.log
ERRORFILE=$ROOTDIR/mac_install.err ERRORFILE=$ROOTDIR/mac_install.err
GCC4ARM_VERSION=gcc-arm-none-eabi-4_7-2012q4 GCC4ARM_VERSION=gcc-arm-none-eabi-4_8-2014q1
GCC4ARM_FILENAME=gcc-arm-none-eabi-4_7-2012q4-20121208-mac.tar.bz2 GCC4ARM_FILENAME=gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2
GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.7/4.7-2012-q4-major/+download/$GCC4ARM_FILENAME GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/$GCC4ARM_FILENAME
GCC4ARM_TAR=$ROOTDIR/$GCC4ARM_FILENAME GCC4ARM_TAR=$ROOTDIR/$GCC4ARM_FILENAME
GCC4ARM_MD5=fcfe3aecbfe77c1e5985845fbe722aac GCC4ARM_MD5=5d34d95a53ba545f1585b9136cbb6805
GCC4ARM_EXTRACT=$ROOTDIR/$GCC4ARM_VERSION GCC4ARM_EXTRACT=$ROOTDIR/$GCC4ARM_VERSION
GCC4ARM_DIR=$ROOTDIR/gcc-arm-none-eabi GCC4ARM_DIR=$ROOTDIR/gcc-arm-none-eabi
GCC4ARM_BINDIR=$GCC4ARM_DIR/bin GCC4ARM_BINDIR=$GCC4ARM_DIR/bin
Expand Down
Binary file modified mri/mri.ar
Binary file not shown.
12 changes: 7 additions & 5 deletions mri/mri.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#include <stdint.h> #include <stdint.h>


/* Used to insert hardcoded breakpoint into user's code. */ /* Used to insert hardcoded breakpoint into user's code. */
#define __debugbreak() do { __asm volatile ("bkpt #0"); } while (0) #ifndef __debugbreak
#define __debugbreak() { __asm volatile ("bkpt #0"); }
#endif


/* Error strings that can be returned to GDB. */ /* Error strings that can be returned to GDB. */
#define MRI_ERROR_INVALID_ARGUMENT "E01" /* Encountered error when parsing command arguments. */ #define MRI_ERROR_INVALID_ARGUMENT "E01" /* Encountered error when parsing command arguments. */
Expand Down Expand Up @@ -91,12 +93,12 @@ int __mriPlatform_CommUartIndex(void);


#ifndef MRI_VERSION_STRING #ifndef MRI_VERSION_STRING


#define MRI_BRANCH "https://github.com/adamgreen/mri/tree/version_0.5" #define MRI_BRANCH "https://github.com/adamgreen/mri/tree/version_0.6"


#define MRI_VERSION_MAJOR 0 #define MRI_VERSION_MAJOR 0
#define MRI_VERSION_MINOR 5 #define MRI_VERSION_MINOR 6
#define MRI_VERSION_BUILD 20130120 #define MRI_VERSION_BUILD 20140515
#define MRI_VERSION_SUBBUILD 1 #define MRI_VERSION_SUBBUILD 2


#define MRI_STR(X) MRI_STR2(X) #define MRI_STR(X) MRI_STR2(X)
#define MRI_STR2(X) #X #define MRI_STR2(X) #X
Expand Down
5 changes: 2 additions & 3 deletions src/modules/robot/Conveyor.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ void Conveyor::on_module_loaded(){
void Conveyor::on_idle(void* argument){ void Conveyor::on_idle(void* argument){
if (queue.tail_i != gc_pending) if (queue.tail_i != gc_pending)
{ {
if (queue.is_empty()) if (queue.is_empty()) {
__debugbreak(); __debugbreak();
else }else{
{
// Cleanly delete block // Cleanly delete block
Block* block = queue.tail_ref(); Block* block = queue.tail_ref();
// block->debug(); // block->debug();
Expand Down
99 changes: 36 additions & 63 deletions win_install.cmd
100755 → 100644
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off @echo off
rem Copyright 2012 Adam Green (http://mbed.org/users/AdamGreen/) rem Copyright 2013 Adam Green (http://mbed.org/users/AdamGreen/)
rem rem
rem Licensed under the Apache License, Version 2.0 (the "License"); rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License. rem you may not use this file except in compliance with the License.
Expand All @@ -19,26 +19,18 @@ setlocal
set ROOTDIR=%~dp0 set ROOTDIR=%~dp0
set LOGFILE=%ROOTDIR%win_install.log set LOGFILE=%ROOTDIR%win_install.log
set ERRORFILE=%ROOTDIR%win_install.err set ERRORFILE=%ROOTDIR%win_install.err

set GCC4ARM_VERSION=gcc-arm-none-eabi-4_8-2014q1
set GCC4ARM_FILENAME=gcc-arm-none-eabi-4_7-2012q4-20121208-linux.tar.bz2 set GCC4ARM_FILENAME=gcc-arm-none-eabi-4_8-2014q1-20140314-win32.zip
set GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.7/4.7-2012-q4-major/+download/%GCC4ARM_FILENAME% set GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/%GCC4ARM_FILENAME%
set GCC4ARM_TAR=%ROOTDIR%%GCC4ARM_FILENAME% set GCC4ARM_TAR=%ROOTDIR%%GCC4ARM_FILENAME%
set GCC4ARM_MD5=%ROOTDIR%build\win32\gcc-arm-none-eabi.md5 set GCC4ARM_MD5=09c19b3248863074f5498a88f31bee16
set GCC4ARM_VERSION=gcc-arm-none-eabi-4_7-2012q4 set GCC4ARM_MD5_FILENAME=%ROOTDIR%gcc-arm-none-eabi.md5
set GCC4ARM_EXTRACT=%ROOTDIR%%GCC4ARM_VERSION%
set GCC4ARM_DIR=%ROOTDIR%gcc-arm-none-eabi set GCC4ARM_DIR=%ROOTDIR%gcc-arm-none-eabi
set GCC4ARM_BINDIR=%GCC4ARM_DIR%\bin set GCC4ARM_BINDIR=%GCC4ARM_DIR%\bin
set GCC4ARM_LIBEXEC=%GCC4ARM_DIR%\lib\gcc\arm-none-eabi\4.7.3 set OUR_MAKE=%ROOTDIR%external\win32\make.exe
set WINBIN_URL=https://github.com/adamgreen/GCC-ARM-Embedded-20121208/tarball/master
set WINBIN_TAR=%ROOTDIR%GCC-ARM-Embedded-20121208.tar.gz

set WINBIN_MD5=%ROOTDIR%build\win32\GCC-ARM-Embedded.md5
set WINBIN_BASEDIR=%ROOTDIR%GCC-ARM-Embedded
set WINBIN_DIR=%WINBIN_BASEDIR%\win32
set OUR_MAKE=%ROOTDIR%build\win32\make.exe
set BUILDENV_CMD=%GCC4ARM_BINDIR%\buildenv.cmd set BUILDENV_CMD=%GCC4ARM_BINDIR%\buildenv.cmd
set BUILDSHELL_CMD=%ROOTDIR%BuildShell.cmd set BUILDSHELL_CMD=%ROOTDIR%BuildShell.cmd
set ERROR_ENCOUNTERED=0 set BUILDSHELL_DEBUG_CMD=%ROOTDIR%BuildShellDebug.cmd




rem Make sure that we are running with current directory set to where this rem Make sure that we are running with current directory set to where this
Expand All @@ -50,67 +42,56 @@ echo Logging install results to %LOGFILE%
echo %DATE% %TIME% Starting %0 %*>%LOGFILE% echo %DATE% %TIME% Starting %0 %*>%LOGFILE%


echo Downloading GNU Tools for ARM Embedded Processors... echo Downloading GNU Tools for ARM Embedded Processors...
echo %DATE% %TIME% Executing build\win32\curl -kL0 %GCC4ARM_URL%>>%LOGFILE% echo %DATE% %TIME% Executing external\win32\curl -kL0 %GCC4ARM_URL%>>%LOGFILE%
build\win32\curl -kL0 %GCC4ARM_URL% >%GCC4ARM_TAR% external\win32\curl -kL0 %GCC4ARM_URL% >%GCC4ARM_TAR%
if errorlevel 1 goto ExitOnError

echo Validating md5 signature of Code Sourcery G++ Lite...
call :RunAndLog build\win32\md5sum --check %GCC4ARM_MD5%
if errorlevel 1 goto ExitOnError

echo Downloading Windows GCC binaries from github...
echo %DATE% %TIME% Executing build\win32\curl -kL0 %WINBIN_URL%>>%LOGFILE%
build\win32\curl -kL0 %WINBIN_URL% >%WINBIN_TAR%
if errorlevel 1 goto ExitOnError if errorlevel 1 goto ExitOnError


echo Validating md5 signature of Windows GCC binaries... echo Validating md5 signature of GNU Tools for ARM Embedded Processors...
call :RunAndLog build\win32\md5sum --check %WINBIN_MD5% echo %GCC4ARM_MD5% *%GCC4ARM_FILENAME%>%GCC4ARM_MD5_FILENAME%
call :RunAndLog external\win32\md5sum --check %GCC4ARM_MD5_FILENAME%
if errorlevel 1 goto ExitOnError if errorlevel 1 goto ExitOnError
del "%GCC4ARM_MD5_FILENAME%"


echo Extracting GNU Tools for ARM Embedded Processors... echo Extracting GNU Tools for ARM Embedded Processors...
call :RunAndLog rd /s /q %GCC4ARM_EXTRACT%
call :RunAndLog rd /s /q %GCC4ARM_DIR% call :RunAndLog rd /s /q %GCC4ARM_DIR%
call :RunAndLog build\win32\bsdtar xf %GCC4ARM_TAR% call :RunAndLog md %GCC4ARM_DIR%
if errorlevel 1 goto ExitOnError
call :RunAndLog move %GCC4ARM_EXTRACT% %GCC4ARM_DIR%
if errorlevel 1 goto ExitOnError

echo Extracting Windows GCC binaries...
call :RunAndLog rd /s /q %WINBIN_BASEDIR%
call :RunAndLog build\win32\bsdtar xf %WINBIN_TAR%
for /d %%i in (adamgreen-GCC-ARM-Embedded-*) do call :RunAndLog move %%i %WINBIN_BASEDIR%
if errorlevel 1 goto ExitOnError

echo Installing Windows binaries...
call :RunAndLog del /q %GCC4ARM_BINDIR%\*
call :RunAndLog copy %WINBIN_DIR%\arm-none-eabi-* %GCC4ARM_BINDIR%\
if errorlevel 1 goto ExitOnError if errorlevel 1 goto ExitOnError
for %%i in (as g++ ld objcopy ranlib ar c++ gcc nm objdump strip) do call :CopyGccFile %%i call :RunAndLog cd %GCC4ARM_DIR%
if "%ERROR_ENCOUNTERED%"=="1" goto ExitOnError call :RunAndLog ..\external\win32\bsdtar xf %GCC4ARM_TAR%
call :RunAndLog xcopy /eiy %WINBIN_DIR%\libexec %GCC4ARM_LIBEXEC%
if errorlevel 1 goto ExitOnError if errorlevel 1 goto ExitOnError
call :RunAndLog cd ..


echo Creating helper scripts... echo Creating helper scripts...
echo @echo off>%BUILDENV_CMD% echo @echo off>%BUILDENV_CMD%
echo REM Uncomment next line and set destination drive to match mbed device>>%BUILDENV_CMD% echo REM Uncomment next line and set destination drive to match mbed device>>%BUILDENV_CMD%
echo REM SET LPC_DEPLOY=copy PROJECT.bin f:\>>%BUILDENV_CMD% echo REM SET LPC_DEPLOY=copy PROJECT.bin f:\>>%BUILDENV_CMD%
echo.>>%BUILDENV_CMD% echo.>>%BUILDENV_CMD%
echo SET PATH=%%~dp0;%%~dp0..\..\build\win32;%%PATH%%>>%BUILDENV_CMD% echo SET PATH=%%~dp0;%%~dp0..\..\external\win32;%%PATH%%>>%BUILDENV_CMD%
rem rem
echo @cmd.exe /K %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd>%BUILDSHELL_CMD% echo @cmd.exe /K %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd>%BUILDSHELL_CMD%
rem
echo @cmd.exe /K "set GCC4MBED_TYPE=Debug& %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd">%BUILDSHELL_DEBUG_CMD%

rem Place GNU Tool for ARM Embedded Processors in the path before building gcc4mbed code.
set path=%GCC4ARM_BINDIR%;%ROOTDIR%external\win32;%PATH%

echo Performing a clean build of the gcc4mbed samples...
call :RunAndLog %OUR_MAKE% clean
if errorlevel 1 goto ExitOnError
call :RunAndLog %OUR_MAKE%
if errorlevel 1 goto ExitOnError


echo Cleaning up intermediate files... echo Cleaning up intermediate files...
call :RunAndLog rd /s /q %WINBIN_BASEDIR%
call :RunAndLog del /f %WINBIN_TAR%
call :RunAndLog del /f %GCC4ARM_TAR% call :RunAndLog del /f %GCC4ARM_TAR%


echo ************************************************************************** echo **************************************************************************
echo To build Smoothie, you will first need to run the following batch echo To build gcc4mbed samples, you will first need to run the following batch
echo file so that your environment variables are set correctly: echo file so that your environment variables are set correctly:
echo %BUILDSHELL_CMD% echo %BUILDSHELL_CMD%
echo You will want to run this each time you start a new Command Prompt. You echo You will want to run this each time you start a new Command Prompt. You
echo can simply double-click on this batch file from Explorer to launch a echo can simply double-click on this batch file from Explorer to launch a
echo Command Prompt that has been properly initialized for building. echo Command Prompt that has been properly initialized for building gcc4mbed
echo based code.
echo ************************************************************************** echo **************************************************************************


rem Restore current directory and exit batch file on success. rem Restore current directory and exit batch file on success.
Expand All @@ -128,17 +109,9 @@ goto :EOF






rem Copies a file between GCC directories where one has arm-none-eabi prefix and the other doesn't
:CopyGccFile
call :RunAndLog del "%GCC4ARM_DIR%\arm-none-eabi\bin\%1"
call :RunAndLog copy /y "%GCC4ARM_BINDIR%\arm-none-eabi-%1.exe" "%GCC4ARM_DIR%\arm-none-eabi\bin\%1.exe"
if errorlevel 1 set ERROR_ENCOUNTERED=1
goto :EOF


rem Exits the batch file due to error. rem Exits the batch file due to error.
rem Make sure that any stderr text ends up in win_install.log and the restore rem Make sure that any stderr text ends up in win_install.log and then restore
rem the current dictory before forcing an early exit. rem the current directory before forcing an early exit.
:ExitOnError :ExitOnError
type %ERRORFILE% >>%LOGFILE% type %ERRORFILE% >>%LOGFILE%
echo %DATE% %TIME% Failure forced early exit>>%LOGFILE% echo %DATE% %TIME% Failure forced early exit>>%LOGFILE%
Expand All @@ -148,4 +121,4 @@ type %LOGFILE%
:Exit :Exit
del %ERRORFILE% del %ERRORFILE%
popd popd
pause pause

0 comments on commit ce6ee09

Please sign in to comment.