Foreword
最近又遇到了一些奇怪的bug,意外发现调试手段上还是有所欠缺,而SES的js脚本可以做更多自定义的工具,可以进一步改造方便疑难杂症使用
Threads Script
需要注意Threads Script用的是Java Script,而不是Jlink Script(前面查了半天发现不对),虽然都简称成了js,但是Jlink Script应该只有Jlink的一些批处理程序才会使用这种方式写脚本
之前有说过SES的RTOS Awareness好像有点问题,老是显示不全,不如Ozone的
貌似这个问题在我提给官方以后修复了
之前有提到显示操作系统线程情况的脚本,这里发现其实这个东西可以自定义的程度还是蛮高的
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1995 - 2019 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* Please note: *
* *
* Knowledge of this file may under no circumstances *
* be used to write a similar product *
* *
* Thank you for your fairness ! *
* *
**********************************************************************
* *
* Current version number will be inserted here *
* when shipment is built. *
* *
**********************************************************************
----------------------------------------------------------------------
File : FreeRTOSPlugin_CM7.js
Purpose : Ozone FreeRTOS-awareness JavaScript Plugin for Cortex-M7
---------------------------END-OF-HEADER------------------------------
*/
/*********************************************************************
*
* Local Functions
*
**********************************************************************
*/
/*********************************************************************
*
* GetTaskStackGrowDir
*
* Function description
* Indicates if the task stack grows in positive (1) or negative (-1) memory direction
*
* Notes
* (1) The stack grow direction depends on the FreeRTOS-port.
* Currently, a positive grow direction is only used on the PIC architecture.
*/
function GetTaskStackGrowDir() {
return -1;
}
/*********************************************************************
*
* GetTaskPrioName
*
* Function description
* Returns the display text of a task priority
*
* Parameters
* Priority: task priority (integer)
*/
function GetTaskPrioName(Priority) {
var sName;
if (Priority == 0) {
sName = "Idle"
} else if (Priority == 1) {
sName = "Low"
} else if (Priority == 2) {
sName = "Normal";
} else if (Priority == 3) {
sName = "High";
} else if (Priority == 4) {
sName = "H