rust-embedded / book

Documentation on how to use the Rust Programming Language to develop firmware for bare metal (microcontroller) devices
https://docs.rust-embedded.org/book/
Apache License 2.0
1.12k stars 179 forks source link

GDB blocks after running the continue command in 2.2-hardware #332

Open BikiniBottomsVeryOwn opened 2 years ago

BikiniBottomsVeryOwn commented 2 years ago

Screenshot from 2022-10-18 02-02-15 Screenshot from 2022-10-18 02-02-39
![Screenshot from 2022-10-18 02-04-41](https://user-images.githubusercontent.com/38847726/196359644-b68be173-b106-4130-8c2e-5c03e764fd8c.png)
Screenshot from 2022-10-18 02-02-58

using with the multiarch setup on ubuntu 22.04

mavjs commented 2 years ago

@BikiniBottomsVeryOwn - if you have the same hardware as the book, in 2.2 hardware, there's a note:

NOTE If GDB blocks the terminal instead of hitting the breakpoint after you issue the continue command above, you might want to double check that the memory region information in the memory.x file is correctly set up for your device (both the starts and lengths).

In which case, make sure your LENGTH for RAM is 40k (RAM : ORIGIN = 0x20000000, LENGTH = 40K) and not 64k which is the default when you clone/generate from the template.

E.g.

$ cat memory.x
/* Linker script for the STM32F303VCT6 */
MEMORY
{
  /* NOTE 1 K = 1 KiBi = 1024 bytes */
  FLASH : ORIGIN = 0x08000000, LENGTH = 256K
  RAM : ORIGIN = 0x20000000, LENGTH = 40K
}