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.
Tool/software:
I am attempting to use the SafeTI start up test code generated by Halcogen in conjunction with the Halcogen derived UART example. I am using the TI compiler with CCS 12.8.1.00005 and the TMDX570LC43HDK dev board.
If I enable any of the start up safety tests, the debug symbols on the task bar are all greyed out and the program does not run. It is not possible to set break points or view registers. This is the case with both debug and release builds. If however I disable some of the start up tests, and reset the board (either a system reset or power on reset) the red error LED lights fleetingly and the release program does indeed run.
This is the working combination of tests which I have arrived at by trial and error:
#define STC_ENABLE 1
#define PBIST_ROM_ENABLE 1
#define PBIST_L2RAM_ENABLE 1
#define PBIST_PERIPHRAM_ENABLE 0
#define PBIST_VIM_ENABLE 0
#define L2RAMECCCHECK_ENABLE 1
#define FLASHECCCHECK_ENABLE 1
#define PERIPHRAMECCCHECK_ENABLE 0
#define EFUSETEST_ENABLE 0
#define CCMR5TEST_ENABLE 1
Is this the expected behaviour? If not, what should I be doing beyond following the instructions in the examples to permit debugging and enable all safety tests?
Hi Paul,
If I enable any of the start up safety tests, the debug symbols on the task bar are all greyed out and the program does not run. It is not possible to set break points or view registers. This is the case with both debug and release builds. If however I disable some of the start up tests, and reset the board (either a system reset or power on reset) the red error LED lights fleetingly and the release program does indeed run.
Did you include SafeTI externally to the HALCoGen generated code?
Because i couldn't see SafeTI directly from HALCoGen for this device, can you please elaborate it further? If you can provide some screenshots on how exactly you are enabling that would be a great help for further debugging this issue.
--
Thanks & regards,
Jagadish.
Thank you for getting back to me.
The safety library is in ~/ti/SafeTI Diagnostic Library and I copied the source code files relevant to the TI compiler into ~/Documents/ti/sluart/source_sl. I replaced two Halcogen generated files with example_SafetyLib.c and example_sci_uart_9600.c, both from the Halcogen examples. The code compiles and with the changes to example_SafetyLib.c outlined in my earler e-mail, it does run following a reset but not under the debugger.
Here are the linker command file, top level makefile and sub directory rules which show the options and include diretories I set.
LINKER FILE:
/*----------------------------------------------------------------------------*/
/* Memory Map */
MEMORY
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0
FLASH1 (RX) : origin=0x00200000 length=0x00200000
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0007EB00
/* USER CODE BEGIN (3) */
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
/* USER CODE BEGIN (5) */
/* USER CODE END */
.intvecs : {} > VECTORS
.text align(32) : {} > FLASH0 | FLASH1
.const align(32) : {} > FLASH0 | FLASH1
.cinit align(32) : {} > FLASH0 | FLASH1
.pinit align(32) : {} > FLASH0 | FLASH1
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
/* USER CODE BEGIN (6) */
LOG_DATA : START( ulLOGStartAddr ), END( ulLOGEndAddr ) > RAM
.sl_stflash_SRAM : RUN = RAM, LOAD = FLASH0|FLASH1, LOAD_START(ulHighHandlerLoadStart), LOAD_END(ulHighHandlerLoadEnd), LOAD_SIZE(ulHighHandlerSize), RUN_START( ulHighHandlerStartAddr ), RUN_END( ulHighHandlerEndAddr )
/* USER CODE END */
}
MAKEFILE:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
CG_TOOL_ROOT := /home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS
GEN_OPTS__FLAG :=
GEN_CMDS__FLAG :=
ORDERED_OBJS += \
"./source/HL_epc.obj" \
"./source/HL_errata.obj" \
"./source/HL_errata_SSWF021_45.obj" \
"./source/HL_esm.obj" \
"./source/HL_nmpu.obj" \
"./source/HL_notification.obj" \
"./source/HL_pinmux.obj" \
"./source/HL_sci.obj" \
"./source/HL_sys_core.obj" \
"./source/HL_sys_dma.obj" \
"./source/HL_sys_intvecs.obj" \
"./source/HL_sys_mpu.obj" \
"./source/HL_sys_pcr.obj" \
"./source/HL_sys_phantom.obj" \
"./source/HL_sys_pmm.obj" \
"./source/HL_sys_pmu.obj" \
"./source/HL_sys_vim.obj" \
"./source/HL_system.obj" \
"./source/example_SafetyLib.obj" \
"./source/example_sci_uart_9600.obj" \
"./source_sl/sl_asm_api.obj" \
"./source_sl/sl_esm.obj" \
"./source_sl/sl_init.obj" \
"./source_sl/sl_log.obj" \
"./source_sl/sl_misc.obj" \
"./source_sl/sl_pmu.obj" \
"./source_sl/sl_priv.obj" \
"./source_sl/sl_selftest.obj" \
"../source/HL_sys_link.cmd" \
$(GEN_CMDS__FLAG) \
-llibc.a \
-include ../makefile.init
RM := rm -rf
RMDIR := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include source/subdir_vars.mk
-include source_sl/subdir_vars.mk
-include source/subdir_rules.mk
-include source_sl/subdir_rules.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C55_DEPS)),)
-include $(C55_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(S67_DEPS)),)
-include $(S67_DEPS)
endif
ifneq ($(strip $(S62_DEPS)),)
-include $(S62_DEPS)
endif
ifneq ($(strip $(S_DEPS)),)
-include $(S_DEPS)
endif
ifneq ($(strip $(OPT_DEPS)),)
-include $(OPT_DEPS)
endif
ifneq ($(strip $(C??_DEPS)),)
-include $(C??_DEPS)
endif
ifneq ($(strip $(ASM_UPPER_DEPS)),)
-include $(ASM_UPPER_DEPS)
endif
ifneq ($(strip $(S??_DEPS)),)
-include $(S??_DEPS)
endif
ifneq ($(strip $(C64_DEPS)),)
-include $(C64_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(S64_DEPS)),)
-include $(S64_DEPS)
endif
ifneq ($(strip $(INO_DEPS)),)
-include $(INO_DEPS)
endif
ifneq ($(strip $(CLA_DEPS)),)
-include $(CLA_DEPS)
endif
ifneq ($(strip $(S55_DEPS)),)
-include $(S55_DEPS)
endif
ifneq ($(strip $(SV7A_DEPS)),)
-include $(SV7A_DEPS)
endif
ifneq ($(strip $(C62_DEPS)),)
-include $(C62_DEPS)
endif
ifneq ($(strip $(C67_DEPS)),)
-include $(C67_DEPS)
endif
ifneq ($(strip $(PDE_DEPS)),)
-include $(PDE_DEPS)
endif
ifneq ($(strip $(K_DEPS)),)
-include $(K_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C43_DEPS)),)
-include $(C43_DEPS)
endif
ifneq ($(strip $(S43_DEPS)),)
-include $(S43_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(SA_DEPS)),)
-include $(SA_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
EXE_OUTPUTS += \
sluart.out
EXE_OUTPUTS__QUOTED += \
"sluart.out"
# All Target
all: $(OBJS) $(CMD_SRCS) $(GEN_CMDS)
@$(MAKE) --no-print-directory -Onone "sluart.out"
# Tool invocations
sluart.out: $(OBJS) $(CMD_SRCS) $(GEN_CMDS)
@echo 'Building target: "$@"'
@echo 'Invoking: Arm Linker'
"/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl" -mv7R5 --code_state=32 --float_support=VFPv3D16 -O2 --define=_INLINE --define=_TMS570LC43x_ --define=_VFP_SUPPORT_=1 --define=EXTERNAL_SP_INIT --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi -z -m"sluart.map" --heap_size=0x800 --stack_size=0x800 -i"/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/lib" -i"/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="sluart_linkInfo.xml" --rom_model --be32 -o "sluart.out" $(ORDERED_OBJS)
@echo 'Finished building target: "$@"'
@echo ' '
# Other Targets
clean:
-$(RM) $(EXE_OUTPUTS__QUOTED)
-$(RM) "source/HL_epc.obj" "source/HL_errata.obj" "source/HL_errata_SSWF021_45.obj" "source/HL_esm.obj" "source/HL_nmpu.obj" "source/HL_notification.obj" "source/HL_pinmux.obj" "source/HL_sci.obj" "source/HL_sys_core.obj" "source/HL_sys_dma.obj" "source/HL_sys_intvecs.obj" "source/HL_sys_mpu.obj" "source/HL_sys_pcr.obj" "source/HL_sys_phantom.obj" "source/HL_sys_pmm.obj" "source/HL_sys_pmu.obj" "source/HL_sys_vim.obj" "source/HL_system.obj" "source/example_SafetyLib.obj" "source/example_sci_uart_9600.obj" "source_sl/sl_asm_api.obj" "source_sl/sl_esm.obj" "source_sl/sl_init.obj" "source_sl/sl_log.obj" "source_sl/sl_misc.obj" "source_sl/sl_pmu.obj" "source_sl/sl_priv.obj" "source_sl/sl_selftest.obj"
-$(RM) "source/HL_epc.d" "source/HL_errata.d" "source/HL_errata_SSWF021_45.d" "source/HL_esm.d" "source/HL_nmpu.d" "source/HL_notification.d" "source/HL_pinmux.d" "source/HL_sci.d" "source/HL_sys_dma.d" "source/HL_sys_pcr.d" "source/HL_sys_phantom.d" "source/HL_sys_pmm.d" "source/HL_sys_vim.d" "source/HL_system.d" "source/example_SafetyLib.d" "source/example_sci_uart_9600.d" "source_sl/sl_esm.d" "source_sl/sl_init.d" "source_sl/sl_log.d" "source_sl/sl_misc.d" "source_sl/sl_priv.d" "source_sl/sl_selftest.d"
-$(RM) "source/HL_sys_core.d" "source/HL_sys_intvecs.d" "source/HL_sys_mpu.d" "source/HL_sys_pmu.d" "source_sl/sl_asm_api.d" "source_sl/sl_pmu.d"
-@echo 'Finished clean'
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
RULES:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Each subdirectory must supply rules for building sources it contributes
source_sl/%.obj: ../source_sl/%.asm $(GEN_OPTS) | $(GEN_FILES) $(GEN_MISC_FILES)
@echo 'Building file: "$<"'
@echo 'Invoking: Arm Compiler'
"/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl" -mv7R5 --code_state=32 --float_support=VFPv3D16 -O2 --include_path="/home/paul/Documents/ti/sluart" --include_path="/home/paul/Documents/ti/sluart/include" --include_path="/home/paul/ti/SafeTI Diagnostic Library/2.3.1/safety_library/include" --include_path="/home/paul/Documents/ti/sluart/source_sl" --include_path="/home/paul/ti/SafeTI Diagnostic Library/2.3.1/hal/include" --include_path="/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include" --define=_INLINE --define=_TMS570LC43x_ --define=_VFP_SUPPORT_=1 --define=EXTERNAL_SP_INIT --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --preproc_with_compile --preproc_dependency="source_sl/$(basename $(<F)).d_raw" --obj_directory="source_sl" $(GEN_OPTS__FLAG) "$(shell echo $<)"
@echo 'Finished building: "$<"'
@echo ' '
source_sl/%.obj: ../source_sl/%.c $(GEN_OPTS) | $(GEN_FILES) $(GEN_MISC_FILES)
@echo 'Building file: "$<"'
@echo 'Invoking: Arm Compiler'
"/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl" -mv7R5 --code_state=32 --float_support=VFPv3D16 -O2 --include_path="/home/paul/Documents/ti/sluart" --include_path="/home/paul/Documents/ti/sluart/include" --include_path="/home/paul/ti/SafeTI Diagnostic Library/2.3.1/safety_library/include" --include_path="/home/paul/Documents/ti/sluart/source_sl" --include_path="/home/paul/ti/SafeTI Diagnostic Library/2.3.1/hal/include" --include_path="/home/paul/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include" --define=_INLINE --define=_TMS570LC43x_ --define=_VFP_SUPPORT_=1 --define=EXTERNAL_SP_INIT --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --preproc_with_compile --preproc_dependency="source_sl/$(basename $(<F)).d_raw" --obj_directory="source_sl" $(GEN_OPTS__FLAG) "$(shell echo $<)"
@echo 'Finished building: "$<"'
@echo ' '
Hi Paul,
My sincere apologies for the delayed response, i was stuck with other issues in this mean time.
#define STC_ENABLE 1
#define PBIST_ROM_ENABLE 1
#define PBIST_L2RAM_ENABLE 1
#define PBIST_PERIPHRAM_ENABLE 0
#define PBIST_VIM_ENABLE 0
#define L2RAMECCCHECK_ENABLE 1
#define FLASHECCCHECK_ENABLE 1
#define PERIPHRAMECCCHECK_ENABLE 0
#define EFUSETEST_ENABLE 0
#define CCMR5TEST_ENABLE 1
I searched these MACROS in the entire safeTI diagnostic library folder of version 2.4.0 and i couldn't find them.
Is it possible to share your project or any sample project with the issue you are talking about? even you can send it through private message. This would help me to debug the issue easily from my end.
--
Thanks & regards,
Jagadish.
Hi Jagadish,
I am using HALCoGen 4.07.01. The help file gives instructions on how to add example_SafetyLib.c (from the HALCoGen examples) to another another HALCoGen project. I initially tried this with example_rtiBlinky but as this would only run from a hard reset I then tried example_sci_uart_9600 so that I could modify it to output the status registers. The MACROS are in example_SafetyLib.c and they determine which tests using the SafeTI library actually run.
I have made the absolute minimum of modifications to the two files
example_SafetyLib.c ...
#define STC_ENABLE 1 // produces errors but runs
#define PBIST_ROM_ENABLE 1
#define PBIST_L2RAM_ENABLE 1
#define PBIST_PERIPHRAM_ENABLE 0
#define PBIST_VIM_ENABLE 0
#define L2RAMECCCHECK_ENABLE 1
#define FLASHECCCHECK_ENABLE 0 // prevents run with variable output
#define PERIPHRAMECCCHECK_ENABLE 0
#define EFUSETEST_ENABLE 0
#define CCMR5TEST_ENABLE 1
... and example_rtiBlinky.c in main() ...
while(1) /* continuous display */
{
cnt1 = (int)sl_esmREG->SR1[0];
cnt2 = (int)sl_esmREG->SR1[1];
cnt3 = (int)sl_esmREG->SR1[2];
sprintf(buf, "sr1: %x %x %x\r\n", cnt1, cnt2, cnt3);
sciDisplayText(UART, (uint8*)buf, strlen(buf));
cnt1 = (int)sl_esmREG->SR4[0];
cnt2 = (int)sl_esmREG->SR4[1];
cnt3 = (int)sl_esmREG->SR4[2];
sprintf(buf, "sr4: %x %x %x\r\n", cnt1, cnt2, cnt3);
sciDisplayText(UART, (uint8*)buf, strlen(buf));
cnt1 = (int)sl_esmREG->SR7[0];
cnt2 = (int)sl_esmREG->SR7[1];
cnt3 = (int)sl_esmREG->SR7[2];
sprintf(buf, "sr7: %x %x %x\r\n", cnt1, cnt2, cnt3);
sciDisplayText(UART, (uint8*)buf, strlen(buf));
cnt1 = (int)sl_esmREG->EPSR;
sprintf(buf, "eps: %x\r\n", cnt1);
sciDisplayText(UART, (uint8*)buf, strlen(buf));
//sciDisplayText(UART,&TEXT1[0],TSIZE1); /* send text code 1 */
wait(200);
};
... and in HL_system.h, I added to resetSource_t
CPU1_RESET = 0x0040U, /**< Alias for CPU 1 Reset */
If I set all the MACROS to zero, the safety library tests are all disabled and the code will happily run under debug. If I enable any of them, it does not and I am unable to view the registers. If I use the combination shown above, the code will run from a hard reset but from the UART output, SR2 is 0x8 and SR4 is 0x100000. All other status registers are zero.
As I didn't seem to be getting anywhere with this I decided to try the example TMS570LC4357_NoOS from the SafeTI Diagnostic Library 2.3.1.
There are actually two files with main() so I chose to use HL_sys_main.c. To resolve some undefined symbols I made the following modification to HL_sys_intvecs.asm ...
; import reference for interrupt routines
.ref _c_int00
.ref _excpt_vec_udef_instr
.ref _excpt_vec_svc
.ref _excpt_vec_abort_pref
.ref _excpt_vec_abort_data
.ref phantomInterrupt
.def resetEntry
... and as SL_Init_StackPointers() is used rather than the _core startup code. I added to HL_sys_startup.c the following ...
uint32 StackModeSVC = SRAM_START;
uint32 StackModeFIQ = SRAM_START + STACK_SIZE_MODE_SVC;
uint32 StackModeIRQ = SRAM_START + STACK_SIZE_MODE_SVC + STACK_SIZE_MODE_FIQ;
uint32 StackModeABT = SRAM_START + STACK_SIZE_MODE_SVC + STACK_SIZE_MODE_FIQ + STACK_SIZE_MODE_IRQ;
uint32 StackModeUND = SRAM_START + STACK_SIZE_MODE_SVC + STACK_SIZE_MODE_FIQ + STACK_SIZE_MODE_IRQ + STACK_SIZE_MODE_ABT;
uint32 StackModeSYS = SRAM_START + STACK_SIZE_MODE_SVC + STACK_SIZE_MODE_FIQ + STACK_SIZE_MODE_IRQ + STACK_SIZE_MODE_ABT + STACK_SIZE_MODE_UND;
... and modified the RAM settings in the linker command file to allow for the rather big stack settings. I carried other modifications to the linker file over from the other HALCoGen example, also the defines symbols (_TMS570LC43x_ _VFP_SUPPORT_=1 but not EXTERNAL_SP_INIT as SL_Init_StackPointers() does this).
The code compiles but once again will not run from debug so I cannot see whether the counters are incrementing.
Needless to say, I am very frustrated. We will need to use the Safety Library for our medical application and I would have hoped that the demonstration examples would work "out of the box". I need to resolve this before we can make any further progress.
Thanks,
Paul