Skip to content

Caveats when converting tx_initialize_low_level.S from Assembly to C #60

@coder137

Description

@coder137

I was able to convert the tx_initialize_low_level.S threadx startup file from Assembly to C for my personal project Link here.

After going through the entire process I have a few questions to ask

  1. The C version of the code is around 32 bytes smaller than the Assembly version of the same (when compiling with Os). Is there any reason/caveats for using Assembly over C or vice versa?
  2. This is assuming that my above conversion is fine in the long run. Currently, I have only tested threadx tasks and that seems to work fine. Would it be possible to review this file and provide any comments here if there are some considerations to be made?
  3. I noticed that there are certain handler functions that are being declared but I cannot find their usage anywhere. Why have they been defined?
  • __tx_IntHandler
  • __tx_SysTickHandler however SysTick_Handler (which runs the same chunk of code) is used since it overrides the weak linkage of the startup function.
  • __tx_BadHandler
  • __tx_HardfaultHandler
  • __tx_SVCallHandler
  • __tx_NMIHandler
  • __tx_DBGHandler

Currently, I haven't tried to make too many changes to the C version of the tx_initialize_low_level and have translated it from assembly to C as closely as possible.
Any pointers or clarification to the above questions would be great!

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions