*
* $LOG$
* 2019/7/20 - ROBIN KRENS
- * Initial version
+ * Initial version
+ * Display some system information, calculate
+ * the amount of SRAM available
*
* */
void sysinfo() {
uint32_t tmp = *MCU_ID;
- printf("# DEVICE ID: ");
+ printf("# DEV ID: ");
if (tmp & 0x414)
printf("HIGH DENSITY\n");
}
tmp = (tmp >> 16);
- printf("# REVISION: ");
+ printf("# REV: ");
switch (tmp) {
case 0x1000:
printf("REVISION A\n");
}
extern char _endofbss;
-
+
uint32_t current_stack = get_msp();
uint32_t stack_usage = (SRAM_OFFSET + SRAM_SIZE) - current_stack;
- uint32_t data_bss = &_endofbss - SRAM_OFFSET;
+ uint32_t data_bss = (uint32_t) &_endofbss - SRAM_OFFSET;
uint32_t mem_free = SRAM_SIZE - stack_usage - data_bss;
- printf("# TOTAL MEMORY: %#x\n", SRAM_SIZE);
-// cputs(regtohex(SRAM_SIZE));
-// cputchar('\n');
- printf("# FREE MEMORY: %#x\n", mem_free);
-// cputs(regtohex(mem_free));
-// cputchar('\n');
- printf("# STACK USAGE: %#x\n", stack_usage);
-// cputs(regtohex(stack_usage));
-// cputchar('\n');
+ printf("# TOTAL MEM: %#x\n", SRAM_SIZE);
+ printf("# FREE MEM: %#x\n", mem_free);
+ printf("# STACK USE: %#x\n", stack_usage);
}