[Solved] Segger Studio: "__asm" Keyword generates error messages

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [Solved] Segger Studio: "__asm" Keyword generates error messages

    Hallo,

    I've tried to compile a project for a STM32F1 eval board, using a FreeRTOS sample. In the according files there are C-Funtions with inline assember code.
    Unfortunately the _asm keyword causes the trouble:


    __asm void vPortSVCHandler ( void )
    {
    PRESERVE8

    ldr r3, =pxCurrentTCB /* Restore the context. */
    ldr r1, [r3] /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */
    .........
    orr r14, #0xd
    bx r14
    }

    [img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAT0AAABmCAIAAAA2x9FKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAADVBJREFUeF7tnV+MFVcdxw+F3bva0AYL8uIDZI2URqMxNcYHEu1DG9pkw5MYH5o21CZqH7ahKkblT0OtNQaIpW6321pirNguRStb0RpLokmXAsJalpXtQtPsdluK7LYLssCy944HZns4e/7PzJm55977vbkhl9kzv/M739/5zO83c++cmfOtx4+0rVhGuNef/jm4/ptf4LeE9vlTnwjNI/gDBYpVgHK7p2+Sf9MtI2NRyO8ILyjQ2AoQcNvYEwCjr0kFwK3PsBGyMX4nNUprrKS7mNt7N+jXPVjLqAC4zSjgtd3TEUv3z4mxnMx60wuGMigAbjOIN3tXgVuWe1n65bfwOdkKWHzFg+9N3iIPQzbrspc3OWAoTwXArR91BUp5htln+YNjsk3HrWwc3PoJdgBWwK23IChZvQrPzBmvspC2Jtss/uVqPItj2DejAuA2o4Dq81tzvhUqXm8eSIbAbX7aVtcyuPWmf375FnWytyDViyFw6y2SjtelXC4gCW3ScYvrUt5CG54hcFv9mFirWXBb/SAF5gG4DSIgBnQBbRARCswJcBtYQOAOFHBQANw6iIQmUCAwBcBtYAGBO1DAQQFw6yASmkCBwBSoYW7xq73A5hLcKU6B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bkC/3YX5BgVwVKJRb/kp1/Fm4di03UNIbKwJuc50ZMB6yAoVyy0No5jbOw7qUC25DnlLwrQAFqsMtY1Ium1kSNnCLM9sCZga6CFmBKnCrBJKlXx5p5NuQpw58q6ICRXOry6Jy2Yw6uYrTAl0HrkCh3ArPHeevJ7PUKlTOuC4V+ASCe1VRoFBuff18CtelqjJX0Gk4CtQ2t/gqKJyZBE+KVKCGuS1SJvQFBYJSANwGFQ44AwWcFAC3TjKhERQISgFwG1Q44AwUcFIA3DrJhEZQICgFwK2fcOhWXZTXajQvquhohznNr7Gos+xnhLASkgLg1k80dGu7UuvsT/K3Vom2KO0wboVhyP74GSeshKEAuPUThwC5NRwv/IwZVqqnALj1o71jfcua8YUuX9+62GE5nCfTatnPOGElDAXArZ846Cpe93rVXPEK9oXGhnob9zz6CXBgVsCtn4CYyYn7MP8q03qm6lKKC9erXPr1M35YKVYBcOtHb/MVJt1VX0NVbLgKJdMo24kPE0i2fqIbnhVwG15M4BEUsCkAbm0K4e9QIDwFwG14MYFHUMCmALi1KYS/Q4HwFAC34cUEHkEBmwLg1qYQ/g4FwlMA3IYXE3gEBWwK/B+mKUotf4mnLAAAAABJRU5ErkJggg==[/img]

    May be some other user had the same problem and can give a hint.

    Thanks a lot.
    Best Regards
    Ralph
  • I have solved the problem. Use CubeMx generate the TureStudio project with the same configuration of the your keil project. Then replace your the port.c and portmacro.h files with the TureStudio generated files in your keil project.
    Because SES use gcc compiler and TureStudio also use gcc, so the ported file can be used in SES.
  • Hello,

    Yes, __asm is Keil specific.
    When porting a Keil project to Embedded Studio all toolchain specific sources and keywords have to be modified to be used with GCC,
    or, as you did, replaced with the corresponding sources for GCC toolchains.

    Best regards
    Johannes
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.