Platform: cmsis: Fix _cmsis_start for gcc C startup support
__copy_table and __zero_table provides a length in bytes not in word
Change-Id: I1f33aeeea94499aeeb78fbfc404ad8608a6fe5ea
Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
diff --git a/platform/ext/cmsis/cmsis_gcc.h b/platform/ext/cmsis/cmsis_gcc.h
index 3ddcc58..2a0999d 100644
--- a/platform/ext/cmsis/cmsis_gcc.h
+++ b/platform/ext/cmsis/cmsis_gcc.h
@@ -149,13 +149,13 @@
extern const __zero_table_t __zero_table_end__;
for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) {
- for(uint32_t i=0u; i<pTable->wlen; ++i) {
+ for(uint32_t i=0u; i<(pTable->wlen/sizeof(pTable->dest)); ++i) {
pTable->dest[i] = pTable->src[i];
}
}
for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) {
- for(uint32_t i=0u; i<pTable->wlen; ++i) {
+ for(uint32_t i=0u; i<(pTable->wlen/sizeof(pTable->dest)); ++i) {
pTable->dest[i] = 0u;
}
}