Baremetal using CMSIS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Baremetal using CMSIS

Jump to solution
559 Views
smishra125
Contributor I

I am a beginner in nxp and need to make a baremetal CMSIS project. I am using LPC55S28JBD100 controller. I don't know how to get started. PLease share some projects and links which help me to learn more on this.

0 Kudos
1 Solution
517 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @smishra125,

I've already answered you in your other post: Trying to build LED blinking project in baremetal - NXP Community.

Regards, Raul.

View solution in original post

0 Kudos
4 Replies
535 Views
smishra125
Contributor I

@danielholala @RaRo I got that and made the project. Also one thing, I want to toggle the LED without GPIO_PORTToggle(). I prepared the code but don't know how to clear the port. I tried to use gpio->CLR[1] = (1<<LED_RED); but it failed.

Following is the code snippet. 

 

void delay_ms(uint32_t count)
{
for(uint32_t i = 0 ; i < count*1000 ; i++);
}

int main(void) {
GPIO_Type *gpio = GPIO;
// TODO: insert code here
//
SYSCON_Type *syscon = SYSCON;

syscon->AHBCLKCTRL.AHBCLKCTRL0 |= (1<<15);//ENABLE GPIO1 CLOCK
syscon->AHBCLKCTRL.AHBCLKCTRL0 |= (1<<13);//ENABLE IOCON CLOCK

gpio->SET[1] = 0xff;//enable gpio 1 for reading/writing
gpio->DIR[1] = 0xff;// make gpio as output

 

// Force the counter to be placed into memory
volatile static int i = 0 ;
// Enter an infinite loop, just incrementing a counter
while(1) {
i++ ;
gpio->B[1][LED_RED] = (1<<LED_RED);
delay_ms(1000);
gpio->B[1][LED_GREEN] = (1<<LED_GREEN);
delay_ms(1000);
gpio->B[1][LED_BLUE] = (1<<LED_BLUE);
delay_ms(1000);
}
return 0 ;
}

0 Kudos
518 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @smishra125,

I've already answered you in your other post: Trying to build LED blinking project in baremetal - NXP Community.

Regards, Raul.

0 Kudos
538 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @smishra125,

First, download an IDE compatible for creating your project, as MCUXpresso IDE

Second, in MCUXpresso IDE (as @danielholala points out) there is a bunch of examples you could try related with CMSIS, but first you need to download the SDK for your microcontroller; there are two ways:

  1. Trough the MCUXpresso IDE

RaulRomero_0-1669339874074.png

  1. Trough the MCUXpresso SDK Builder

RaulRomero_1-1669339874084.png

You can access the examples in MCUXpresso IDE as follows:

  1. Click on Import SDK example(s)…

RaulRomero_2-1669339874089.png

  1. Select the micro or board related with the SDK you download it

RaulRomero_3-1669339874094.png

  1. Then search for CMSIS examples

RaulRomero_4-1669339874099.png

Third, if you are searching for more information, I recommend you take a look to the following links: Overview CMSIS, and CMSIS: Cortex Microcontroller Software Interface Standard.

Regards, Raul

0 Kudos
550 Views
danielholala
Senior Contributor II

Have you installed the SDK for your controller? If so, then import an SDK example and have a look at the source code. There are CMSIS driver examples for I2C, SPI and USART interfaces.

0 Kudos