Preparing for maintenance release -

Bug fix - issue introduced in V8.2.2 when the current timer list is empty and the overflow timer list is not empty.
Add PIC32MZ EF (floating point) support and update the MZ demo project to test the flop context switching.
Improve efficiency of the stack overflow checking.
Add CLI to RX71M demo.
General tidy up of new RZ and RX projects - including ensuring the UART driver copes with 0 length strings.
Add stack overflow checking to the [old] PIC24 demo.
This commit is contained in:
Richard Barry 2015-10-15 20:19:26 +00:00
parent 38cb08133d
commit 57cc3389a5
84 changed files with 4972 additions and 1813 deletions

View file

@ -93,18 +93,31 @@
#include "ConfigPerformance.h"
/* Core configuration fuse settings */
#pragma config FMIIEN = OFF, FETHIO = OFF, PGL1WAY = OFF, PMDL1WAY = OFF, IOL1WAY = OFF, FUSBIDIO = OFF
#pragma config FNOSC = SPLL, FSOSCEN = OFF, IESO = OFF, POSCMOD = EC
#pragma config OSCIOFNC = OFF, FCKSM = CSECMD, FWDTEN = OFF, FDMTEN = OFF
#pragma config DMTINTV = WIN_127_128, WDTSPGM = STOP, WINDIS= NORMAL
#pragma config WDTPS = PS1048576, FWDTWINSZ = WINSZ_25, DMTCNT = DMT31
#pragma config FPLLIDIV = DIV_3, FPLLRNG = RANGE_13_26_MHZ, FPLLICLK = PLL_POSC
#pragma config FPLLMULT = MUL_50, FPLLODIV = DIV_2, UPLLFSEL = FREQ_12MHZ, UPLLEN = OFF
#pragma config EJTAGBEN = NORMAL, DBGPER = PG_ALL, FSLEEP = OFF, FECCCON = OFF_UNLOCKED
#pragma config BOOTISA = MIPS32, TRCEN = ON, ICESEL = ICS_PGx2, JTAGEN = OFF, DEBUG = ON
#pragma config CP = OFF
#pragma config_alt FWDTEN=OFF
#pragma config_alt USERID = 0x1234u
#if defined(__32MZ2048ECM144) || defined(__32MZ2048ECH144)
#pragma config FMIIEN = OFF, FETHIO = OFF, PGL1WAY = OFF, PMDL1WAY = OFF, IOL1WAY = OFF, FUSBIDIO = OFF
#pragma config FNOSC = SPLL, FSOSCEN = OFF, IESO = OFF, POSCMOD = EC
#pragma config OSCIOFNC = OFF, FCKSM = CSECMD, FWDTEN = OFF, FDMTEN = OFF
#pragma config DMTINTV = WIN_127_128, WDTSPGM = STOP, WINDIS= NORMAL
#pragma config WDTPS = PS1048576, FWDTWINSZ = WINSZ_25, DMTCNT = DMT31
#pragma config FPLLIDIV = DIV_3, FPLLRNG = RANGE_13_26_MHZ, FPLLICLK = PLL_POSC
#pragma config FPLLMULT = MUL_50, FPLLODIV = DIV_2, UPLLFSEL = FREQ_12MHZ, UPLLEN = OFF
#pragma config EJTAGBEN = NORMAL, DBGPER = PG_ALL, FSLEEP = OFF, FECCCON = OFF_UNLOCKED
#pragma config BOOTISA = MIPS32, TRCEN = ON, ICESEL = ICS_PGx2, JTAGEN = OFF, DEBUG = ON
#pragma config CP = OFF
#pragma config_alt FWDTEN=OFF
#pragma config_alt USERID = 0x1234u
#elif defined(__32MZ2048EFM144) || defined(__32MZ2048EFH144)
#pragma config FMIIEN = OFF, FETHIO = OFF, PGL1WAY = OFF, PMDL1WAY = OFF, IOL1WAY = OFF, FUSBIDIO = OFF
#pragma config FNOSC = SPLL, FSOSCEN = OFF, IESO = OFF, POSCMOD = EC
#pragma config OSCIOFNC = OFF, FCKSM = CSECMD, FWDTEN = OFF, FDMTEN = OFF
#pragma config DMTINTV = WIN_127_128, WDTSPGM = STOP, WINDIS= NORMAL
#pragma config WDTPS = PS1048576, FWDTWINSZ = WINSZ_25, DMTCNT = DMT31
#pragma config FPLLIDIV = DIV_3, FPLLRNG = RANGE_13_26_MHZ, FPLLICLK = PLL_POSC
#pragma config FPLLMULT = MUL_50, FPLLODIV = DIV_2, UPLLFSEL = FREQ_12MHZ
#pragma config EJTAGBEN = NORMAL, DBGPER = PG_ALL, FSLEEP = OFF, FECCCON = OFF_UNLOCKED
#pragma config BOOTISA = MIPS32, TRCEN = ON, ICESEL = ICS_PGx2, JTAGEN = OFF, DEBUG = ON
#pragma config CP = OFF
#endif
/*-----------------------------------------------------------*/
@ -274,27 +287,44 @@ static enum {
EXCEP_CpU, /* coprocessor unusable */
EXCEP_Overflow, /* arithmetic overflow */
EXCEP_Trap, /* trap (possible divide by zero) */
EXCEP_FPE = 15, /* floating point exception */
EXCEP_IS1 = 16, /* implementation specfic 1 */
EXCEP_CEU, /* CorExtend Unuseable */
EXCEP_C2E /* coprocessor 2 */
EXCEP_C2E, /* coprocessor 2 */
EXCEP_DSPDis = 26 /* DSP module disabled */
} _excep_code;
static unsigned long _epc_code;
static unsigned long _excep_addr;
asm volatile( "mfc0 %0,$13" : "=r" (_epc_code) );
asm volatile( "mfc0 %0,$14" : "=r" (_excep_addr) );
asm volatile( "mfc0 %0,$13" : "=r" (_epc_code) );
asm volatile( "mfc0 %0,$14" : "=r" (_excep_addr) );
_excep_code = ( _epc_code & 0x0000007C ) >> 2;
_excep_code = ( _epc_code & 0x0000007C ) >> 2;
for( ;; )
{
/* prevent compiler warning */
(void) _excep_code;
/* Examine _excep_code to identify the type of exception. Examine
_excep_addr to find the address that caused the exception */
LATHSET = 0x0007;
Nop();
Nop();
Nop();
}
}
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;
/* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. */
taskDISABLE_INTERRUPTS();
for( ;; );
}