器件型号: LAUNCHXL-F28379D
我构建了自定义引导加载程序、适用于 blanky 等简单代码、它不会崩溃、而当我尝试使用包含 RTOS 的逻辑刷写更大的数据时、下面提供了我如何转移到应用程序的逻辑以供参考、CRC 校验与数据匹配、因此跳转到应用程序逻辑时会出现问题吗? JumptoApp function.c 、或者 C2000 十六进制实用程序本身生成的二进制文件是否构成问题?
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.
器件型号: LAUNCHXL-F28379D
我构建了自定义引导加载程序、适用于 blanky 等简单代码、它不会崩溃、而当我尝试使用包含 RTOS 的逻辑刷写更大的数据时、下面提供了我如何转移到应用程序的逻辑以供参考、CRC 校验与数据匹配、因此跳转到应用程序逻辑时会出现问题吗? JumptoApp function.c 、或者 C2000 十六进制实用程序本身生成的二进制文件是否构成问题?
您好 Matt、
我已经完成了以下迭代:-
1.重置/取消初始化所有使用的外设。
2、函数指针、汇编代码、软件重置、看门狗重置等功能,可转到新应用,但不起作用。
3.我已经给了应用程序项目的几乎所有可用内存,可以在我发送给您的链接器中看到。
4.我还尝试了硬件电源复位,而不是软件或函数指针来执行应用程序。 但它崩溃了。
C2000 Hex 实用程序是否会正确生成.bin 文件、对吗?
我强烈建议我们通过团队电话或 Gmeet 或有助于更快解决问题的方式会面。
此致、
谢谢您、
Smeet
您好、Smeet、
链接器分配的所有资源

栈段必须位于低位 64KB 中、因为栈指针被限制在此范围内。 如果有任何动态任务、堆也将具有相同的限制。 可以定义 configAPPLICATION_ALLOCATED_HEAP 并手动将堆对象放置在此范围内。
除此之外、我看不到 RTOS 应用在加载后的行为应该与裸机应用不同的任何原因、前提是它独立运行良好。 如果您看到任何变化、请告诉我。
此致、
Arnav
您好:
感谢您提供更多详细信息。
memcpy(&RamfuncsRunStart、&RamfuncsLoadStart、(size_t)&RamfuncsLoadSize);
InitSysCtrl() 已经 为 ramfuncs 执行 memcpy()、因此不需要额外的复制。 我认为这不会导致任何致命错误。
还需要检查以下几点:
void main(void)
{
//
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();
//
// Step 2. Initialize GPIO:
// This example function is found in the F2837xD_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
//
InitGpio();
//
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
DINT;
//
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the F2837xD_PieCtrl.c file.
//
InitPieCtrl();
//
// Disable CPU interrupts and clear all CPU interrupt flags:
//
IER = 0x0000;
IFR = 0x0000;
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in F2837xD_DefaultIsr.c.
// This function is found in F2837xD_PieVect.c.
//
InitPieVectTable();
//
// Step 4. User specific code, enable interrupts:
//
//
// Step 5. Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
}
是 C2000 Hex 实用程序本身生成的二进制文件问题
将哪些参数传递到十六进制实用程序?
此致、
马特
您好:
不用担心、感谢您对此进行检查。
我与 PIE 专家讨论了这个问题、他们提到 配置 PIE CPU/CPU 中断的顺序可能会很麻烦。 您可以尝试以下跳转代码吗? 我将 IER/IFR 清零、直到 PIEACK 位清零以匹配 TI 示例代码。
void JumpToApp(void)
{
/* 1. Disable watchdog */
EALLOW;
WdRegs.WDCR.all = 0x0068;
EDIS;
/* 2. Disable global interrupts */
DINT;
/* 4. Disable PIE */
EALLOW;
PieCtrlRegs.PIECTRL.bit.ENPIE = 0;
EDIS;
/* 5. Clear all PIE interrupt enables */
PieCtrlRegs.PIEIER1.all = 0;
PieCtrlRegs.PIEIER2.all = 0;
PieCtrlRegs.PIEIER3.all = 0;
PieCtrlRegs.PIEIER4.all = 0;
PieCtrlRegs.PIEIER5.all = 0;
PieCtrlRegs.PIEIER6.all = 0;
PieCtrlRegs.PIEIER7.all = 0;
PieCtrlRegs.PIEIER8.all = 0;
PieCtrlRegs.PIEIER9.all = 0;
PieCtrlRegs.PIEIER10.all = 0;
PieCtrlRegs.PIEIER11.all = 0;
PieCtrlRegs.PIEIER12.all = 0;
/* 6. Clear all PIE interrupt flags */
PieCtrlRegs.PIEIFR1.all = 0;
PieCtrlRegs.PIEIFR2.all = 0;
PieCtrlRegs.PIEIFR3.all = 0;
PieCtrlRegs.PIEIFR4.all = 0;
PieCtrlRegs.PIEIFR5.all = 0;
PieCtrlRegs.PIEIFR6.all = 0;
PieCtrlRegs.PIEIFR7.all = 0;
PieCtrlRegs.PIEIFR8.all = 0;
PieCtrlRegs.PIEIFR9.all = 0;
PieCtrlRegs.PIEIFR10.all = 0;
PieCtrlRegs.PIEIFR11.all = 0;
PieCtrlRegs.PIEIFR12.all = 0;
/* 7. Acknowledge all PIE groups */
PieCtrlRegs.PIEACK.all = 0xFFFF;
/* 3. Clear interrupt flags and enables */
IER = 0x0000;
IFR = 0x0000;
/* 8. TI Recommended: Indirect branch through XAR7 */
// __asm(" MOVL XAR7, #0x084000"); /* Load app address */
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" NOP");
__asm(" LB 0x084000"); /* Indirect branch */
/* Should never reach here */
while(1);
}
此致、
马特
您好 Matt、
您提供的上述代码不起作用。
但我有另一个意见、可能有助于我们更好地理解问题。
最简单的闪烁的工作原理,但当写来切换 led 逻辑在函数中,然后调用它在 while (1) 时,它崩溃。 它与栈初始化有什么关系吗? 或者、如果有人使用_cinit?
#include "F28x_Project.h"
void led(void)
{
// Toggle GPIO 34 (Port B uses GPBTOGGLE)
GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1;
// Slow Delay (approx 500ms)
DELAY_US(500000);
}
// Red LED is on GPIO 34 (Port B)
void main(void)
{
InitSysCtrl();
InitGpio();
EALLOW;
WdRegs.WDCR.all = 0x0068; /* Disable watchdog */
EDIS;
// Setup Red LED (GPIO 34)
GPIO_SetupPinMux(34, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(34, GPIO_OUTPUT, GPIO_PUSHPULL);
volatile uint16_t x = 0;
while(1)
{
led();
}
}