-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bring up to par with cortex-m-rt v0.6.x #4
Conversation
- this brings in cortex-m-rt attributes: entry, pre_init and interrupt - it also removes almost all dependencies on unstable features -- only the msp430-interrupt ABI is left behind. - it also removes the abort-on-panic feature and the panic_handler (panic_impl lang item)
|
Some preliminary answers/responses to your q's/comments: 1./2. The MSP430F55{1,2}x family is an example of an MSP430 (not X) core with 23 interrupts, and up to 64 are reserved (page 53). Assuming you make the vector table a fixed 64 entries, that's (64-16)*2= 96 bytes lost to the vector table on small devices like the MSP430G2211 I use for AT2XT, or about 5% overhead.
|
@Disasm Per agreement w/ @japaric, we are waiting a few months (post-thesis) to discuss merging this. @japaric By agreement, |
@japaric I've started looking into bring
|
… have different vector start locations.
…ymbols are PROVIDEd.
@japaric There are some problems I need to resolve locally (along with updating documentation), but I have confirmed your changes work and I can access peripherals with the Re: 1., 2. and 3. I have gone back to the old style of having the user specify a I wish to punt on 4. and 6. for now and come back to them later. Re: 5.
I'm taking care of the required changes on my end- at least, the ones required to play nice with this crate's breaking changes :). My additions to this PR can be found here: https://github.com/cr1901/msp430-rt/tree/rt-up |
msp430-interrupt ABI is left behind.
I have a few questions / comments related to some of the changes I made
I have assumed that the vector table is always 32 bytes in size. That seems to the maximum vector table for MSP430 CPUs AFAICT (MSP430X CPUs support more interrupts). Is this table size correct? Or should it be bigger to accommodate some device?
Like I said the vector table is fixed size. This means that if your device has less than 15 interrupts (plus Reset) the table will still be 32 bytes in size so you won't be able to use the free space for your program. In other words, your .text + .rodata end address can not exceed 0xFFE0 even if the vector table starts at e.g. 0xFFF0.
Just a comment: because the vector table is now fixed size the VECTORS memory region is no longer used and doesn't need to be included in memory.x. Instead the ROM memory region should always have end address equal to 0x1_0000 because the .vector_table section is placed at the end of ROM. (I should document this requirement better)
Is there any interrupt handler that should be forbidden from returning? In Cortex-M land the HardFault handler fires on invalid memory access, execution of illegal / undefined instructions, etc. Returning from this exception would resume a program that's in an invalid state and would result in UB. For this reason we have the
exception
attribute enforce that the HardFault handler is a divergent function (fn() -> !
). Is there anything like that in MSP430 land?A heads up: This is a breaking change that will require regenerating
devicePAC crates with svd2rust v0.14.0 (I need to land some MSP430 changes in svd2rust before making the v0.14.0 release)r? @cr1901
cc @awygle