How to convert dsPIC33 HEX file to binary? - microcontroller

I have a HEX file for my application on dsPIC33, now I want to send the file over to microcontroller via serially.
As the HEX file generated by the compiler are intel hex format, I tried to convert it to binary with arm-none-eabi-objcopy, which, as expected does not work.
Is there any tool to convert HEX or ELF files to raw binary for dsPIC33?

You could use the MPLAx IPE.
When you load your .hex file and bulid an environment you will get an .bin file,

So I have to look through/read .hex files on occasion, much easier when they are in .bin. If you have a linux host, install hex2bin, and then just simply execute "./hex2bin <filename.hex>", then use something like GHex to read through the file.

Related

How to convert .xls or .xlxs file to csv file without any plugins or tools using Unix command

I have to convert .xls or .xlxs file to .csv file without using plugins or tools using Unix Command
Is their any way to do this ?
I Tried to do like this below ...But not working
Change the characterSet code from .xls file to UTF-8 encoding
Then create file again with extension change
cp temp.xls temp.csv
It is possible, but you need to realise that an *.xls file is a zipped directory structure (just unzip such a file, using Winzip or 7-zip). The unzipping can also be done using UNIX commands.
But what then? The directory structure is quite complicated to understand, and in order to create a script or a program which can do this (without using any external tools) is a tremendous work, so I'd propose you, either to use external tools anyway, or to make sure the files you receive already are CSV format.

Is there a command to convert a directory of .sid files to .mp3 files?

I am looking for a command to convert a directory of .sid files to .mp3 files. Thank you.
(Sid files are named after the Sound Interface Chip found in Commodore 64 personal computers.)
Yes, but you need two conversion utilities: SID to WAV and ffmpeg ;
this approach needs two passes, first in wav format and then in mp3.
You did not specify a target language, but a loop over all *.sid files in your directory is very simple to do, in Bash or Powershell.

compile file from file_pb.js to file.proto

I know how could I compile from file.proto to file_pb.js using this command:
c:\protobuf\bin\protoc.exe --js_out=import_style=commonjs,binary:. .\file.proto
But, how I can convert from file_pb.js to file.proto
You are unlikely to find a tool that does what you are asking for. The process of compiling a .proto file to a programming language was not intended to be reversible. The intention is for the .proto file to be the "source of truth" that directly describes APIs and the structure of the messages.

PuTTY Plink save files name to text file, and PSFTP only those

I am trying to take the files that I get with PuTTY's Plink command but save the file names to a text file so that I can only pull those files with PSFTP afterwards. Or can this be done without a temp text file?
The files I get are modified in the last 15 min, and I only want to get those files. I am new to PuTTY and FTP in general. I searched everywhere but cannot find anything that helps.
Any help is appreciated,
Thank you
You have to generate the PSFTP script file dynamically by reading the Plink output file line by line and producing a put command for each line.
See Batch files: How to read a file?
Or use an SFTP client that can directly download only files created in the last 15 minutes.
For example with WinSCP scripting:
winscp.com /command ^
"open sftp://username:password#example.com/ -hostkey=""fingerprint""" ^
"get /path/*>15N c:\path\" ^
"exit"
Read about file masks with a time constraint.
(I'm the author of WinSCP)

Error "Invalid Parameter" fom ImageMagick convert on Windows

I am trying to convert a PDF document into a PNG file using ImageMagick command line tools from a ASP.NET website. I create a new shell process and ahve it execute the following command:
convert -density 96x96 "[FileNameAndPath].pdf" "[FileNameAndPath].png"
This runs well when testing the website on my local machine with the ASP.NET Develeopment Server of VS and the command also works well when manually entered into the shell. When running from the programatically created shell in ASP.NET there is the following error message:
Invalid Parameter - 96x96
Does anybody know why that happens and what to do?
I have tested the command while being logged in on the server via RDP with a different user account than the ASP.NET process. I have used exactly the same ImageMagick and Ghostscript installation files as on my local machine and have activated adding the ImageMagick installation path to the enironment variables during installing. The server has not been rebooted since than.
convert is also the name of a windows executable which converts FAT filesystem to NTFS. When you do not specify the full path of an executable, quote:
...the system first searches the current working directory and then
searches the path environment variable, examining each
directory from left to right, looking for an executable filename that
matches the command name given.
"C:\Windows\System32" is generally present in the beginning of %PATH% variable, causing the Windows convert utility to launch, which fails with "Invalid Parameter" error as expected.
Try specifying the full path of the ImageMagick's convert.exe like so:
"C:\Program Files\ImageMagick\convert.exe" -density 96x96 "path_and_filename.pdf" "path_and_filename.png"
As others have stated convert points to a different program in your PATH. Instead preface your command with magick. So your command would instead be:
magick convert -density 96x96 "[FileNameAndPath].pdf" "[FileNameAndPath].png"
In Window actually exists a "convert.exe" in system32 - make sure your script doesn't start that one (maybe the environment paths on your development machine are set differently).
I am only answering this late because imagemagick was updated. Now, if you wish to use the "convert" command, you do it like this:
magick convert "image.png" "document.pdf"
or
magick convert "image_00*.png" "document.pdf"
for multiple images.
Same syntax for command, just add magick before it
A couple more options for fixing this:
Edit your Path system variable to contain the path to imagemagick
as it's first content and then add the rest after it. This will make
windows always find the imagemagic convert first before it finds
the other convert program. So something like this: C:\Program Files\ImageMagick-6.9.2-Q16;C:\Program Files\Haskell Platform\2014.2.0.0\lib\extralibs\bin;...
Another option is to create a dedicated folder somewhere on your machine where you will place shortcuts for some of these name clashes. Then what you do is that you rename those shortcuts to meaningful names, for example convert_image_magick, then add the path to this folder to your system path. So now as you hit tab more, you will finally find the right program you want to run
yes! if you launch an Administrator command window it defaults to C:\windows\sytem32\ ... as long as you're not in that directory the command will pickup the ImageMagick convert.exe
My issue was I was using the "FORFILES" command which is tricky because it requires using
"cmd /c" and passing the convert command with #path and #file parameters and it does some escaping of slashes... needless to say it's caused me hours and hours of headache. It even parses hex characters, like if your filepath has the combination 0x00 in it, it will think that's a hex value and mangle your path. I had a filepath named C:\ImageRes3000x3000
and FORFILES interprets that literally and it caused a strange path issue. Sorry if this is a long useless post but it's meant to be FYI, if someone runs across this, maybe it will help them. That being said, FORFILES and "convert.exe" are a powerful and simple image renaming line script combo.
here's my full 3 line image renaming script
robocopy D:\SRC_DIR\ D:\DEST_DIR\_staging *.jpg /e /MAXAGE:2
FORFILES /P D:\DEST_DIR\_staging\ /S /M *.jpg /C "cmd /c convert.exe #path -quality 65 -resize 1500 D:\RESIZED_DIR\\#file"
DEL D:\DEST_DIR\_staging\*.* /S /Q

Resources