Pavel Pisa created an issue: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5539



## Summary

The internal SRAM build are useful for testing of TMS570 modifications and 
builds. If the system is not reconfigured by some loader or application then it 
is necessary to enable TMS570_USE_HWINIT_STARTUP even for internal ram builds 
(i.e. `tms570ls3137_hdk_intram`). But the code in bsp_start_hook_0 resolves 
test for running from SRAM incorrectly which leads to less critical problem 
that internal SRAM could be left uninitialized when application is placed in 
Flash and it has fatal consequence for SRAM builds when it results in 
application clearing itself.

## Steps to reproduce

When build configuration is modified to allow test TMS570 BSP hardware 
initialization code even for internal SRAM builds, then application 
clears/zeroes itself and cannot continue. 

```
diff --git a/spec/build/bsps/arm/tms570/objhwinitlc4357hdk.yml 
b/spec/build/bsps/arm/tms570/objhwinitlc4357hdk.yml
index 1b91475804..71ca6b8b47 100644
--- a/spec/build/bsps/arm/tms570/objhwinitlc4357hdk.yml
+++ b/spec/build/bsps/arm/tms570/objhwinitlc4357hdk.yml
@@ -5,7 +5,9 @@ copyrights:
 - Copyright (C) 2023 embedded brains GmbH & Co. KG
 cppflags: []
 cxxflags: []
-enabled-by: arm/tms570lc4357_hdk
+enabled-by:
+  - arm/tms570lc4357_hdk
+  - arm/tms570lc4357_hdk_intram
 includes: []
 install: []
 links: []
diff --git a/spec/build/bsps/arm/tms570/optlowinit.yml 
b/spec/build/bsps/arm/tms570/optlowinit.yml
index 32b84aa08c..7bfd42202b 100644
--- a/spec/build/bsps/arm/tms570/optlowinit.yml
+++ b/spec/build/bsps/arm/tms570/optlowinit.yml
@@ -10,6 +10,7 @@ default:
 - enabled-by:
   - arm/tms570ls3137_hdk
   - arm/tms570lc4357_hdk
+  - arm/tms570lc4357_hdk_intram
   value: true
 - enabled-by: true
   value: false
```

## Expected behaviour

Expected behavior is working `ticker.exe` and other applications.

The correction is simple

```
diff --git a/bsps/arm/tms570/start/bspstarthooks-hwinit.c 
b/bsps/arm/tms570/start/bspstarthooks-hwinit.c
index 6407cc4a45..980f90cd20 100644
--- a/bsps/arm/tms570/start/bspstarthooks-hwinit.c
+++ b/bsps/arm/tms570/start/bspstarthooks-hwinit.c
@@ -60,7 +60,7 @@ __attribute__((__naked__)) void bsp_start_hook_0( void )
     "ldr r1, =#" RTEMS_XSTRING( TMS570_MEMORY_SRAM_SIZE ) "\n"
     "sub r0, lr, r0\n"
     "cmp r1, r0\n"
-    "blt 1f\n"
+    "bhi 1f\n"

     /*
      * Initialize the SRAM if we are not running in SRAM.  While we are called,
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5539
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to