ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
28 марта
971651 Топик полностью
Nikolay_Po (19.01.2020 17:50, просмотров: 260) ответил SciFi на Процессор при старте читает ячейку с нулевым адресом и записывает в SP. Такшта начальное значение SP можете увидеть прямо в хекс-файле прошивки.
Спасибо. Нашёл в мануале: "After this startup delay has elapsed, the CPU fetches the top-of-stack value from address 0x0000 0000, then starts code execution from the boot memory starting from 0x0000 0004". Непонятно, где в прошивке искать этот адрес, 0x00000000. Флеш начинается по адресу 0x80000000 и зеркалится на... Возможно, используется не подходящий режим загрузки: Depending on the selected boot mode, main Flash memory, system memory or SRAM is accessible as follows:
  • Boot from main Flash memory: the main Flash memory is aliased in the boot memory space (0x0000 0000), but still accessible from its original memory space (0x800 0000). In other words, the Flash memory contents can be accessed starting from address 0x0000 0000 or 0x800 0000.
  • Boot from system memory: the system memory is aliased in the boot memory space (0x0000 0000), but still accessible from its original memory space (0x1FFF B000 in connectivity line devices, 0x1FFF F000 in other devices).
  • Boot from the embedded SRAM: SRAM is accessible only at address 0x2000 0000.
  • У меня "connectivity line device" и замечал, что отладка, перед main(), иногда останавливается на адресах в районе 0x1FFFF000, типа того:
    undefined debug reason 8 - target needs reset
    target halted due to debug-request, current mode: Thread 
    xPSR: 0x01000000 pc: 0x1fffe9c0 msp: 0x20000ff0
    target halted due to debug-request, current mode: Thread 
    xPSR: 0x01000000 pc: 0x1fffe9c0 msp: 0x20000ff0
    А потом уже попадал в main().