Build Problem MPLAB v6.20

Thread Starter

Mudezer

Joined Nov 11, 2024
1
Hello I'm brand new to MPLAB, I'm working on a PIC32SG Curiosity Ultra and all I'm trying to do is to make blink the LED1 of the board (port PB25).
All I did was creating a new project, adding a timer TCC0 to the project and allocating it to the non secure area, generating the different files through Harmony and modifying the main.c from the non secure area to allow the led to blink.

Now when I try to build and load the program on my board, the build fails with this error:
1731342650135.png

After looking through different explanations found on the net, I still don't understand why I get those errors...
I don't modify that much the files, all I do is to generate them with harmony.

Can someone give me help of some sort?
Many thanks :D
 

nsaspook

Joined Aug 27, 2009
16,249
Show us the blink-led program source.

Look at the generated source for what TCOO expects as a interrupt handler.

C:
/*******************************************************************************
  Main Source File

  Company:
    Microchip Technology Inc.

  File Name:
    main.c

  Summary:
    This file contains the "main" function for a project.

  Description:
    This file contains the "main" function for a project.  The
    "main" function calls the "SYS_Initialize" function to initialize the state
    machines of all modules in the system
 *******************************************************************************/

// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************

#include <stddef.h>                     // Defines NULL
#include <stdbool.h>                    // Defines true
#include <stdlib.h>                     // Defines EXIT_FAILURE
#include "definitions.h"                // SYS function prototypes


// *****************************************************************************
// *****************************************************************************
// Section: Main Entry Point
// *****************************************************************************
// *****************************************************************************

/*
 * C function prototype for TCC0 TCC0_OTHER_InterruptHandler function
 */
void blink_led(uint32_t, uintptr_t);

int main(void)
{
    /* Initialize all modules */
    SYS_Initialize(NULL);

    TCC0_TimerCallbackRegister(blink_led, 0); // register the callback function
    TCC0_TimerStart();

    while (true) {
        /* Maintain state machines of all polled MPLAB Harmony modules. */
        SYS_Tasks();
    }

    /* Execution should not come here during normal operation */

    return( EXIT_FAILURE);
}

/*
 * the TCC0 TCC0_OTHER_Interrupt calls this
 */
void blink_led(uint32_t status, uintptr_t context)
{
    LED1_Toggle();
}
/*******************************************************************************
 End of File
 */
Untested (on real hardware) as I don't have that processor handy but it was generated and compiles without errors.


Sample code project zip
 

Attachments

Top