Giter Club home page Giter Club logo

Comments (6)

ErichStyger avatar ErichStyger commented on July 18, 2024

Hi Grzegorz,
thank you for your feedback. I have do admit that I'm not really using S12X any more, but I should still have a board somewhere. And I have used FreeRTOS with S12X only in a small project which was not banked (I believe), so it very well could be something I have missed. From your description it sounds that the Processor Expert code dealing with the tick interrupt should be different, and not sure what I have to change.
Could you provide the pice of source code you have changed so I can follow up on this? Maybe best with clear indication what you have changed where?

Thanks,
Erich

from mcuoneclipse.

grzsob avatar grzsob commented on July 18, 2024

Hi Erich,
I attach 2 modified and 2 original files, both generated by PE. Here's what happens in my understanding:

  • TickCntr1_Interrupt occurs and program goes to ISR handler, PPAGE register stays intact
  • ISR handler calls TickCntr1_OnInterrupt() with CALL instruction and PPAGE register may change if there are multiple flash pages used and this function is on different one than function when interrupt happened.
  • portSAVE_CONTEXT macro is called and possibly incorrect PPAGE register is pushed on stack
  • at the end of function portRESTORE_CONTEXT macro is called and possibly incorrect PPAGE value is pulled from stack and copied to register which results in jumping to random place in code

Solution would be to move portSAVE_CONTEXT macro to primary ISR handler - before function call(attached files), or move everything to ISR handler (and then remove code that fixes stack with LEAS instructions).

S12X_issue42.zip

BR
Grzegorz Sobczyk

from mcuoneclipse.

ErichStyger avatar ErichStyger commented on July 18, 2024

Hi Grzegorz,
thanks for the extra details. I wanted to investigate this last weekend, but did not find the time. I hope because you have found a solution it is not that urgent?

Thanks,
Erich

from mcuoneclipse.

grzsob avatar grzsob commented on July 18, 2024

from mcuoneclipse.

ErichStyger avatar ErichStyger commented on July 18, 2024

You can disable the overwrite if you disable code generation for a component, see https://mcuoneclipse.com/2012/03/23/disable-my-code-generation/

from mcuoneclipse.

ErichStyger avatar ErichStyger commented on July 18, 2024

closing issue: for now disabling code generation should do it.

from mcuoneclipse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.