
Raspberry Pi Board Support Package
This package contains project templates, system files and example programs for the Raspberry Pi Foundation Raspberry Pi.
CrossWorks Version 3 Installation Instructions
This package can only be installed if you have the following CrossWorks license bolt-ons:
- ARM License
- To install this support package
-
- Click the Tools > Package Manager menu option to open the package manager window.
- Right click on the Raspberry Pi Board Support Package entry and select Install Selected Packages.
- Click Next to take you to the summary page.
- Click Next to install the package.
- Click Finish to close the package manager window.
- Click the Tools > Show Installed Packages.
- Click on the Raspberry Pi Board Support Package link to view the package and its contents.
- To manually install this support package
-
- If you have not done so already, follow the CrossWorks Tasking Library Package installation instructions.
- Download the file Raspberry_Pi.hzq using your web browser.
- Click the Tools > Manually Install Packages menu option.
- Select the file you have just downloaded to install the package.
- Click the Tools > Show Installed Packages.
- Click on the Raspberry Pi Board Support Package link to view the package and its contents.
- To install this support package using other versions
Release Notes
3.1
- Updated packages and documentation. Added some hardware sample code projects
3.0
- Initial Release.
Documentation
Creating and debugging Rasperry Pi Projects
To create a new Rasperry Pi project
- Select the File > New > New Project menu item.
- Select the appropriate Raspberry Pi project from the Categories list.
- Select the required project template type from the Templates list.
- Set the required project name and location directory.
- Click OK.
To build an application
- Select the project to work on by using the Project > Set Active Project menu option.
- Select the configuration you require by using the Build > Set Active Build Configuration menu option.
- Build the project by using the Build > Build Project menu option.
To load an application using the Raspberry Pi SD card (and a host computer)
- If this is the first time then backup the kernel.img file on the Raspberry Pi SD card.
- Use File | Open CrossStudio | Project Folder to get a File Explorer on the project directory.
- Copy the kernel.img produced by the application build to the file kernel.img on the Raspberry Pi SD card.
To debug an application via JTAG
- Ensure that the file config.txt on the root of the SD card has the following command to enable the JTAG port on the 40-way header: enable_jtag_gpio=1.
- Ensure that the Raspberry Pi has booted (via the SD card) a kernel.img produced by the CrossWorks build process.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug > Start Debugging.
Raspberry Pi Project Specifics
Target Startup Code
The startup code Raspberry_Pi_Startup.s contains the exceptions vectors, reset_handler and irq_handler code. There are a set of preprocessor defines that configure the startup code which are documented in the startup file itself.
Target Reset Script
The reset script Raspberry_Pi_Target.js stops the target then turns off and invalidates the cache. Since there is no (known) way to reset a Raspberry Pi under debug control you should reset any peripheral registers here if your application assumes them to be in a reset state.
CTL support
The file Raspberry_Pi_ctl_board.c implements the ctl_set_isr, ctl_unmask_isr and ctl_mask_isr functions by programming the BCM2835 interrupt controller register group. The vector parameter to these functions corresponds to the interrupts table in the BCM2835 ARM Peripherals document. The priority and trigger parameters to the ctl_set_isr function are not used. The startup code Raspberry_Pi_Startup.s implements the irq_handler exception handler. This file also implements the CTL timer using the ARM Timer and has led and button support.
Header and Memory map files
The file Raspberry_Pi_MemoryMap.xml describes the memory and peripherals of the Raspberry Pi and BCM2835. The file BCM2835_IO.h is a C header file that is generated from the memory map file.