What is HALCoGen?

HALCoGen stands for hardware abstraction layer (HAL) code generator. It’s a tool provided by TI for their Hercules series microcontrollers (including the RM46) to generate the HAL.

Think of the HAL as some code that abstracts away a lot of the very low-level code required to interact with hardware. It makes it significantly easier for us to use the RM46 microcontroller.

Check outHow-To: CCS & HALCoGen Demo after going through this document if you’d like to try creating an example HALCoGen project.

Setup

  1. Start HALCoGen
  2. Go to File → Open → Project

Untitled

  1. Select the rm46_gcc_test.hcg file located in the OBC-firmware/hal/ directory. This should open up the project which looks something like the following image.

Untitled

Introducing the Different Tabs

So you’ll quickly notice that there are a ton of tabs in HALCoGen. I’ll go through the main tabs that you’ll probably need.

Untitled

In the future, if you’re not sure what a tab is for, refer to the technical reference manual or the support forums.

RM46L852PGE_FREERTOS

This tab contains a lot of the general configuration details for the RM46.

General

This tab just displays a block diagram for the microcontroller. If a block is greyed out, it could mean 1 of 2 things:

  1. The module doesn’t exist for your specific microcontroller. For example, the RM46L852PGE doesn’t have a SPI2 module.