<re_irc>
<Lachlan> I'm trying to figure out how to determine the size of the .text section by generating symbols in the linker script. Has anyone else done this before?
<re_irc>
<dirbaio> making the binary itself know its own size?
<re_irc>
<dirbaio> there's already __stext, __etext in the cmrt linker script
<re_irc>
<Lachlan> Oh sick
<re_irc>
<Lachlan> Yeah, that's exactly what I'm doing
<re_irc>
<usize> Hello all, I'm new to Rust Embedded development and I'm running into an issue which might be very simple for this group. I have a MSP432E401Y Launchpad board and I'm trying to get a simple GPIO LED toggle program using the cortex_m_quickstart (https://github.com/prabhpreet/gpio-hello). For the peripherals, I've generated a PAC using svd2rust (https://github.com/prabhpreet/msp432e401y-rs). When I run it using GDB/OpenOCD,...
<re_irc>
... on attempting a peripheral register write for GPION registers, it directs to the Hard Fault handler (image above)
<re_irc>
<usize> On the openocd terminal as well, I see that it fails to read the memory where the peripheral registers are located:
<re_irc>
Error: Failed to read memory at 0x40064400
<re_irc>
Info : SWD DPIDR 0x2ba01477
<re_irc>
Error: Failed to read memory at 0x40064504
<re_irc>
<usize> +I'd appreciate any guidance on how to troubleshoot further. Apologies for the newb questions
<re_irc>
<jannic> I don't know that MCU at all. Some chips can completely disable some peripherals and often they are disabled by default. Perhaps there is some bit in some other register you need to set first? Look for power and clock settings.
<re_irc>
<jannic> Perhaps PCGPIO?
emerent has quit [Ping timeout: 248 seconds]
emerent has joined #rust-embedded
<re_irc>
<9names (@9names:matrix.org)> i happen to have one of those boards (that I've never used), two secs while i get the TI tools installed.
<re_irc>
<9names (@9names:matrix.org)> thanks for sharing the code you're using, it makes it much easier to help troubleshoot.
<re_irc>
two quick things: you probably want a cargo config file in your project so that you don't have to specify a target when building:
<re_irc>
<usize> Thank you, will look into the power on registers!
<re_irc>
<9names (@9names:matrix.org)> i'm assuming they do like the latter MSP430s where all the peripherals are powered off at boot?
<re_irc>
<usize> Thank you, my .gitignore ignored this file, will add that to my repo in case there is an issue with the config file (I have added Cortex M4F target there)
<re_irc>
<usize> You're right, I was using a C++ API when using C++ where System Peripherals do get enabled first. I will give this a try with enabling the registers they use in the API. Thank you so much for the guidance!
<re_irc>
<9names (@9names:matrix.org)> it's great that XDS110 on this board supports CMSIS-DAP as well as the TI propriety protocols, so debugging this thing with probe-rs should be possible once the CMSIS pack has been imported.
<re_irc>
<usize> Thank you, will keep this in mind!
<re_irc>
<9names (@9names:matrix.org)> regarding the GDB errors: i seem to remember that you need to tell openocd which memory regions are allowed to be accessed. it's been a while since i've touched openocd so i might be wrong here.
<re_irc>
<usize> I tried to specify the chipname manually by creating an openocd cfg file:
<re_irc>
<9names (@9names:matrix.org)> hmm, looking at the MSP432 blinky example it seems you need to write to msp432e401y_rs::sysctl::rcgcgpio::SYSCTL_RCGCGPIO_R12_W first
<re_irc>
that's the clock-gating control register for GPIO portn
<re_irc>
<usize> Trying that now, thanks!
<re_irc>
<9names (@9names:matrix.org)> hmm, i think we've got some linker issues here. my generated elf doesn't have a main, does yours?
Amadiro__ has joined #rust-embedded
Amadiro_ has quit [Ping timeout: 240 seconds]
<re_irc>
<usize> 9names: I'm not getting the hard fault after setting the clock-gating control register, and am able to see a main on expanding the [#entry] macro, stepping through the code:
<re_irc>
<usize> * The hard fault did not occur after setting the clock-gating control register! I'm
<re_irc>
<usize> Just trying to set the LED drivers and push/pull down configuration registers to see if I can get the LED to light up. Thanks 9names for your help!!!
<re_irc>
<barafael> silvergasp: interesting, can you link your project?
<re_irc>
<9names (@9names:matrix.org)> usize: it's not happening with the updated version of your repo so it must be something i did
<re_irc>
<usize> 9names: The PAC I have for this microcontroller is stored locally for me. Have you cloned this locally (https://github.com/prabhpreet/msp432e401y-rs) and had your Cargo.toml point to the local folder for msp432e401y-rs?
<re_irc>
<9names (@9names:matrix.org)> yes, i already did that to start. first thing i did was look in your cargo.tom to work out what i needed
aspe has joined #rust-embedded
aspe has quit [Client Quit]
mrkajetanp_ has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
mrkajetanp has joined #rust-embedded
<re_irc>
<9names (@9names:matrix.org)> ah. final trick is to enable digital IO mode for the pin.