mdebug | Debugger For Cortex-M MCUs

 by   swetland C Version: Current License: Apache-2.0

kandi X-RAY | mdebug Summary

kandi X-RAY | mdebug Summary

mdebug is a C library. mdebug has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

This is a debugger for Cortex-M MCUs using SWD (serial wire debug) and (optionally) SWO. It provides basic standalone functionality including memory inspection and modification, processor halt, register inspection, single stepping, breakpoints, etc. It also acts as a GDB agent, allowing GDB to control the target device. Previously it used a custom debug probe board (m3debug). In its current iteration firmware is provided for the readily available (and much more powerful) LPC Link 2 probe board, which is available from Digikey for under $20: It provides flashing functionality via "flash agents" which are little programs downloaded to the target board RAM and then controlled by the debugger. Currently agents are included for the lpc13xx, lpc15xx, stm32f4xx series MCUs and the lpclink2 board itself (lpc43xx + spifi). Recently it’s seem the most testing against stm32f4xx and lpc43xx MCUs. It has previously been used successfully with lpc13xx, lpc15xx, and stm32f2xx MCUs. Firmware for the LPC Link 2 and installation instructions are in the firmware directory. Firmware source code is part of the lk embedded kernel project (look in app/mdebug):
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mdebug has a low active ecosystem.
              It has 12 star(s) with 0 fork(s). There are 8 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              mdebug has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mdebug is current.

            kandi-Quality Quality

              mdebug has no bugs reported.

            kandi-Security Security

              mdebug has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              mdebug is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mdebug releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mdebug
            Get all kandi verified functions for this library.

            mdebug Key Features

            No Key Features are available at this moment for mdebug.

            mdebug Examples and Code Snippets

            No Code Snippets are available at this moment for mdebug.

            Community Discussions

            QUESTION

            concatenate results after multiprocessing
            Asked 2020-Nov-25 at 19:14

            I have a function which is creating a data frame by doing multiprocessing on a df:-

            Suppose if I am having 10 rows in my df so the function processor will process all 10 rows separately. what I want is to concatenate all the output of the function processor and make one data frame.

            ...

            ANSWER

            Answered 2020-Nov-25 at 19:14

            you can use either the data frame constructor or concat to solve your problem. the appropriate one to use depends on details of your code that you haven't included

            here's a more complete example:

            Source https://stackoverflow.com/questions/64981106

            QUESTION

            What %lo(source)($6) and .frame mean in assembly code?
            Asked 2020-Jun-12 at 02:15

            I assemble a simple c program to mips and try to understand the assembly code. By comparing with c code, I almost understand the it but still get some problems.

            I use mips-gcc to generate assembly code: $ mips-gcc -S -O2 -fno-delayed-branch -I/usr/include lab3_ex3.c -o lab3_ex3.s

            Here is my guess about how the assembly code works:

            main is the entry of the program.

            $6 is the address of source array.

            $7 is the address of dest array.

            $3 is the size of source array.

            $2 is the variable k and is initialized to 0.

            $L3 is the loop

            $5 and $4 are addresses of source[k] and dest[k].

            sw $3,0($5) is equivalent to store source[k] in $3.

            lw $3,4($4) is equivalent to assign source[k] to dest[k].

            addiu $2,$2,4 is equivalent to k++.

            bne $3, $0, $L3 means that if source[k] is zero then exits the loop otherwise jump to lable $L3.

            $L2 just do some clean up work.

            Set $2 to zero.

            Jump to $31 (return address).

            My problems is:

            1. What .frame $sp,0,$31 does?
            2. Why lw $3,4($4) instead of lw $3,0($4)
            3. What is the notation%lo(source)($6) means? ($hi and $lo$ registers are used in multiply so why they are used here?)

            Thanks.

            C

            ...

            ANSWER

            Answered 2020-Jun-11 at 10:17

            Firstly, main, $L3 and $L2 are labels for 3 basic blocks. You are roughly correct about their functions.

            Question 1: What is .frame doing

            This is not a MIPS instruction. It is metadata describing the (stack) frame for this function:

            • The stack is pointed to by $sp, an alias for $29.
            • and the size of the stack frame (0, since the function has neither local variables, nor arguments on the stack). Further, the function is simple enough that it can work with scratch registers and does not need to save callee-saved registers $16-$23.
            • the old return address ($31 for MIPS calling convention)

            For more information regarding the MIPS calling convention, see this doc.

            Question 2: Why lw $3,4($4) instead of lw $3,0($4)

            This is due to an optimization of the loop. Normally, the sequence of loads and stores would be :

            • load source[0]
            • store dest[0]
            • load source[1]
            • store dest[1] ....

            You assume that the loop is entirely in $L3, and that contains load source[k] and store dest[k]. It isn't. There are two clues to see this:

            • There is a load in the block main which does not correspond to any load outside the loop
            • Within the basic block $L3, the store is before the load.

            In fact, load source[0] is performed in the basic-block named main. Then, the loop in the basic block $L3 is store dest[k];load source[k+1];. Therefore, the load uses an offset of 4 more than the offset of the store, because it is loading the integer for the next iteration.

            Question 3: What is the lo/hi syntax?

            This has to do with instruction encodings and pointers. Let us assume a 32-bit architecture, i.e. a pointer is 32 bits. Like most fixed-size instruction ISAs, let us assume that the instruction size is also 32 bits.

            Before loading and storing from the source/dest arrays, you need to load their pointers into registers $6 and $7 respectively. Therefore, you need an instruction to load a 32-bit constant address into a register. However, a 32-bit instruction must contain a few bits to encode opcodes (which operation the instruction is), destination register etc. Therefore, an instruction has less than 32 bits left to encode constants (called immediates). Therefore, you need two instructions to load a 32-bit constant into a register, each loading 16 bits. The lo/hi refer to which half of the constant is loaded.

            Example: Assume that dest is at address 0xabcd1234. There are two instructions to load this value into $7.

            Source https://stackoverflow.com/questions/62321050

            QUESTION

            C/C++ DLL failing after .NET framework upgrade from 3.5 to 4.6
            Asked 2019-Nov-07 at 08:34

            I have application called as Agent which have 2 projects :

            1. C# project
            2. C/C++ DLL

            Whole application was running fine with .NET 3.5 which we use to build with vs2008. Due to some requirement we upgraded the .Net Framework to 4.6 and vs 2019 to build this up. Now my application service runs but looks like C/C++ dll exports are failing somewhere. What I have tried: C# side

            ...

            ANSWER

            Answered 2019-Nov-07 at 08:34

            This is likely happening because .Net 4 changed the way that it corrects incorrect P/Invoke calling conventions.

            From https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ee941656(v=vs.100):

            To improve performance in interoperability with unmanaged code, incorrect calling conventions in a platform invoke now cause the application to fail. In previous versions, the marshaling layer resolved these errors up the stack.

            To solve this, you must specify the correct calling convention in the P/Invoke declaration, e.g.

            Source https://stackoverflow.com/questions/58744621

            QUESTION

            How to create a table with composite primary key in sqlite?
            Asked 2019-Sep-24 at 15:35

            I have an Android app and I simply want to create a table with 2 primary keys:

            ...

            ANSWER

            Answered 2019-Sep-24 at 15:35

            Earlier in your table definition you defined the column COL_REMOTE_FOLDER_ID as a primary key. So, when the second composite primary key definition is encountered, you get an error. Remove the first primary key definition and it should work:

            Source https://stackoverflow.com/questions/58083696

            QUESTION

            Setting the x axis position to y = 0 in MPAndroid Bar Chart
            Asked 2019-Apr-15 at 21:07

            I've been struggling with this for a while now, but I can't find a way to have an x axis, with its labels, lie at the position y = 0. This is important when I have both positive and negative values- I don't want to put the axis at the defaults given by AndroidMPChart (TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE), as none of these apply.

            I have managed to edit the xAxisRenderer, and have been able to pass the ratio of my maxY value to my minY value, hoping to manually find the position to set the axis. The issue with this, however, is that I need the position of the highest Y bar and lowest Y bar. I can find the position of the lowest Y bar no problem, using mViewPortHandler.contentBottom(), but using mViewPortHandler.contentTop() does not give me the top of the Y bar for some reason.

            ...

            ANSWER

            Answered 2019-Apr-15 at 21:07

            This is how I solved the problem--

            in the renderAxisLine function =>

            Source https://stackoverflow.com/questions/55661121

            QUESTION

            setResult(Activity.RESULT_OK, returnedIntent) from child activity always return me an Activity.CANCELED to main activity
            Asked 2019-Mar-07 at 10:10

            I want to return some data from my child Activity ActivityChild to my main Activity ActivityMain

            I first call my ActivityChild from my ActivityMain this way :

            ...

            ANSWER

            Answered 2019-Mar-07 at 02:51

            You can consider adding this flag FLAG_ACTIVITY_FORWARD_RESULT to your returnedIntent. It is described here https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_FORWARD_RESULT

            If set and this intent is being used to launch a new activity from an existing one, then the reply target of the existing activity will be transferred to the new activity. This way, the new activity can call Activity.setResult(int) and have that result sent back to the reply target of the original activity.

            Source https://stackoverflow.com/questions/55034009

            QUESTION

            Android Service not staying alive after app closes
            Asked 2019-Mar-06 at 15:30

            I want to have a background service, which will stay alive after the app is closed and which I can bind to again when the app is started.

            For testing I made it that a counter will increase every time I bind to the service.

            So theoretically the app should start, I will create the service, then bind to it -> the counter should move up.

            Then I close the app and press the Bind button again and It should log a "1" and move the counter up again.

            But it doesn't ... It will display a 0 every time I restart the app and bind to it ...

            This is my current Test - Service - class:

            ...

            ANSWER

            Answered 2019-Mar-05 at 19:08

            If you actively close the app (by closing it from the Android activity list), Android will most likely kill your service. You can see that in your apps Logcat. The only real way around that is a foreground service.

            Furthermore, onBind will not be called every time you bind to the service. From the Android documentation:

            You can connect multiple clients to a service simultaneously. However, the system caches the IBinder service communication channel. In other words, the system calls the service's onBind() method to generate the IBinder only when the first client binds. The system then delivers that same IBinder to all additional clients that bind to that same service, without calling onBind() again.

            Secondly, just that onStartCommand is called does not mean the service is recreated. It can be called multiple times during the service life cycle. For instance, each time startService is called, onStartCommand is executed, but the service is not necessarily recreated.

            Also, it looks like you do not un-bind the service when closing the activity. That makes your activity leak the ServiceConnection and your app crash. It would explain why you see the service re-created every time you close and re-start the app.

            Try adding an unbind in your activity's onPause method:

            Source https://stackoverflow.com/questions/55006592

            QUESTION

            Result of file.createNewFile(); is ignored while exporting SQLite database to CSV Android Java
            Asked 2019-Mar-04 at 20:35

            I am trying to export my SQLite database to CSV, using ExportDatabaseCSVTask.

            After several corrections, this is how this looks like:

            Upon the button click in CatalogActivity:

            ...

            ANSWER

            Answered 2019-Mar-03 at 11:46

            In onPreExecute() change to this:

            Source https://stackoverflow.com/questions/54963307

            QUESTION

            Compiling libcurl for Android 64
            Asked 2018-Oct-19 at 23:45

            I'm trying to create a Android 64-bit libcurl static library with SSL support.

            I first compile OpenSSL with the help of this script https://github.com/cocochpie/android-openssl/blob/master/build-all-arch.sh. I've modified it so that it only builds for Android 64-bit and I see the following output:

            ...

            ANSWER

            Answered 2018-Oct-19 at 23:45

            I managed to find a fantastic script for building what I needed: https://github.com/leenjewel/openssl_for_ios_and_android.

            The big take away for me here was that if you see 'SSL support: no' and you are expecting to see 'yes' then it's one of two things: 1) it cannot find the path to SSL or 2) the path might be there but the compiled SSL is for the wrong architecture.

            As Daniel Stenberg mentioned config.log is your friend here.

            Source https://stackoverflow.com/questions/52375753

            QUESTION

            Is it possible to remotely debug a Mono console app from Visual Studio?
            Asked 2018-Jan-13 at 10:42

            I want to use latest Mono (5.4.1.6) to write a console app in Visual Studio 2015/2017 for a Raspberry Pi 3 (Linux). Searching the web I've found that it is possible to use Visual Studio, but there are limitations.

            I can use MonoRemoteDebugger, but I also need to target Mono framework, not .NET framework, because I do not know if they are fully compatible. Adding the Mono target profile works only up to profile 4.0 and I want to use the latest Mono (.NET 4.5).

            MDebug looks fine, but it is not free.

            Mono Helper also looks fine, but how can I remotely debug the app?

            I can use Xamarin Studio 6.3 configured for remote debugging, but I have not tested it and I do not know how well it works. Also, I prefer Visual Studio and it would be great if I avoided installing a different IDE if VS could do the job.

            So, is it possible to remotely debug Mono app from Visual Studio? Should I try Visual Studio Code?

            If I finished my app, then how can I generate the release build?

            I've noticed that the plugins have the option to debug the app, but not for generating the release build.

            This is new to me and information found on the web did not help me understand everything I need to do my work. Any help would be appreciated. Thank you!

            ...

            ANSWER

            Answered 2018-Jan-13 at 10:42

            It seems it is not possible with free software. I can use Visual Studio with MonoRemoteDebugger and if I have doubts about code compatibility, I can build the project in Xamarin which permits targeting Mono.

            Source https://stackoverflow.com/questions/48187932

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mdebug

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/swetland/mdebug.git

          • CLI

            gh repo clone swetland/mdebug

          • sshUrl

            git@github.com:swetland/mdebug.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link