This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP432P401R
I recently completed RTOS course based on MSP432 Red Launchpad. I also came across the driver library (drivelib) for the MSP432 launchpad and I wanted to use it in my existing projects. But whenever I include any driver library functions to my existing project, the code does not run. When I tried to debug, the control is stuck at the Reset_Handler of the startup_msp432p401r_uvision.sfile. Whenever I comment out the driver library functions such as MAP_WDT_A_holdTimer(), the code runs fine. Here's my main function:
int main(void){ OS_Init(); UART0_Init(); OutValue("\n\rPWM Dutycycle =",0); /* Halting the watchdog */ // MAP_WDT_A_holdTimer(); /* Configuring GPIO2.4 | GPIO2.5 as peripheral output for PWM and P1.4 | P1.1 for button * interrupt */ // MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN4, // GPIO_PRIMARY_MODULE_FUNCTION); // P2SEL0 |= 0x10; // P1SEL1 &= ~0x10; // configure P2.4 as primary module function // /* Configuring Timer_A to have a period of approximately 500ms and // * an initial duty cycle of 10% of that (3200 ticks) */ // MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig1); return 0; }
Whenever I uncomment any MAP_ functions which are the driver library functions, the code gets stuck:
I have also attached my project folder if anyone wants to try out.6433.Timer_A_with_Lab6.zip
Hello,
Thank you for your interest in our product! I am looking into this issue for you and I expect I will have a response for you by tomorrow.
Hello,
I know I promised a response today, so I'll give you an update. I notice it appears you are using KEIL IDE. I use CCS. I began looking into this this afternoon and ran into a lot of include/library types of errors which I had to workout before I could even build the project properly. I did get it built so that it is ready to run and I can start looking into the debug of the issue you are having now, but I am out of time for today. Tomorrow I will continue by loading your code onto my launchpad device and then running through debug to replicate and then resolve your issue.
Thank you for your patience.
I was not able to replicate the issue yet because I am runnning into a different issue with loader_exit() occuring.
I am curious what RTOS is this as it does not look like it is TI_RTOS. Are you using TI_RTOS or another RTOS?
Also, I have asked around a little bit and a common concern I have heard is if the watchdog timer is being turned off in OS_init() here or if not whether the program is being halted due to the WDT prior to reaching the command to turn it off? Have you tried moving the MAP_WDT_A_holdTimer() function above your OS_Init() ?
Hi John,
The RTOS running is not TI_RTOS. I took Real-time Bluetooth Networks course and the project is based on that. It is not a full-fledged RTOS and not advanced like TI_RTOS or FreeRTOS.
John P. Morrison said:Have you tried moving the MAP_WDT_A_holdTimer() function above your OS_Init() ?
Yes. I tried that also. But no effect. Even tried commenting MAP_WDT_A_holdTimer() and adding only MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION);
But same result. Stuck at the Reset_Handler.
Hello,
I am wondering if you have been able to find a solution to this yet? I was able to run a driverlib api inside of an TI-RTOS example today just by inserting the following:
/* DriverLib Includes */
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>
I started out using the empty TI-RTOS example. Here is what I put into the empty.c file:
/* * Copyright (c) 2015-2016, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * ======== empty.c ======== */ /* DriverLib Includes */ #include <ti/devices/msp432p4xx/driverlib/driverlib.h> #include <stdbool.h> /* For usleep() */ #include <unistd.h> #include <stdint.h> #include <stddef.h> /* Driver Header files */ #include <ti/drivers/GPIO.h> // #include <ti/drivers/I2C.h> // #include <ti/drivers/SDSPI.h> // #include <ti/drivers/SPI.h> // #include <ti/drivers/UART.h> // #include <ti/drivers/Watchdog.h> /* Board Header file */ #include "Board.h" /* * ======== mainThread ======== */ void *mainThread(void *arg0) { volatile uint32_t ii; /* Configuring P1.0 as output */ MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0); while (1) { /* Delay Loop */ for(ii=0;ii<500000;ii++) { } MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); } }
This managed to blink the led for me, using driverlib API's.
I assume the Stuck at Reset_Handler may have to do with some other portion of the code and not directly related to the addition of driverlib functions.
Hi John,
To accomplish my end task with my existing RTOS code, I used direct registry access instead of drivelib and it worked well.
Good to know that drivelib is working fine with TI-RTOS. Will try out. :)
**Attention** This is a public forum