Programming an Attiny85 - avr

I was wondering how to upload a program I wrote using AVR Studio 4 to an ATtiny85. I was basically using this tutorial http://blog.smileymicros.com/smileys-workshop-10-moving-beyond-arduino/ except doing everything with an attiny85 instead of an atmega328. I got the pins_arduino.h from HighLow tech's ATtiny library.
I have compiled successfully in AVR Studio 4 and am now wondering how to upload to an Attiny85.
Thanks

Download the Windows-Avrdude version: http://www.mikrocontroller.net/attachment/69851/avrdude-5.10.zip
Extract the avrdude.exe files (avrdude.conf and avrdude.exe anywhere in your directories.
Now in AVR Studio, create a new tool under external tools (don't know exactly if it is called external tools) and call it 'ATtiny85'.
Paste this line in the command field: C:\Path\To\Your\avrdude.exe.
Paste this in 'Arguments': -F -v -pt85 -cstk500v1 -P com7 -b19200 -Uflash:w:"$(ProjectDir)Debug\$(ItemFileName).hex":i -C
Make sure you replace 'com7' with your com port you've attached your avrisp mkii to.
Now finish the dialog and your ready to upload. (Just click your tool in the Menu)

Related

How can I figure out which framework was used for build desktop application's (Zoom) UI?

I would like to know which framework was used to build Zoom(windows & mac)'s UI.
Is that possible somehow? Would decompiling help?
Zoom's desktop application
You can download Zoom's Linux client and choose Other Linux OS from the drop down menu. Then run the following command in a Linux terminal:
$ tar -xf zoom_x86_64.tar.xz
The execution of the command results in a directory called zoom being created and when you list it's contents using this command:
$ ls zoom
You get the following output:
audio libQt5DBus.so.5 libQt5QuickTemplates2.so.5.12.9 libturbojpeg.so
dingdong1.pcm libQt5DBus.so.5.12 libQt5QuickWidgets.so meeting_chat_chime.pcm
dingdong.pcm libQt5DBus.so.5.12.9 libQt5QuickWidgets.so.5 meeting_raisehand_chime.pcm
double_beep.pcm libQt5Gui.so libQt5QuickWidgets.so.5.12 platforminputcontexts
Droplet.pcm libQt5Gui.so.5 libQt5QuickWidgets.so.5.12.9 platforms
egldeviceintegrations libQt5Gui.so.5.12 libQt5Script.so platformthemes
Embedded.properties libQt5Gui.so.5.12.9 libQt5Script.so.5 Qt
generic libQt5Network.so libQt5Script.so.5.12 qt.conf
getbssid.sh libQt5Network.so.5 libQt5Script.so.5.12.9 QtGraphicalEffects
getmem.sh libQt5Network.so.5.12 libQt5Svg.so QtQml
iconengines libQt5Network.so.5.12.9 libQt5Svg.so.5 QtQuick
imageformats libQt5OpenGL.so libQt5Svg.so.5.12 QtQuick.2
json libQt5OpenGL.so.5 libQt5Svg.so.5.12.9 QtWayland
leave.pcm libQt5OpenGL.so.5.12 libQt5WaylandClient.so record_start.pcm
libfdkaac2.so libQt5OpenGL.so.5.12.9 libQt5WaylandClient.so.5 record_stop.pcm
libicudata.so libQt5Qml.so libQt5WaylandClient.so.5.12 ring.pcm
libicudata.so.56 libQt5Qml.so.5 libQt5WaylandClient.so.5.12.9 ringtone
libicudata.so.56.1 libQt5Qml.so.5.12 libQt5Widgets.so sip
libicui18n.so libQt5Qml.so.5.12.9 libQt5Widgets.so.5 timezones
libicui18n.so.56 libQt5QuickControls2.so libQt5Widgets.so.5.12 translations
libicui18n.so.56.1 libQt5QuickControls2.so.5 libQt5Widgets.so.5.12.9 version.txt
libicuuc.so libQt5QuickControls2.so.5.12 libQt5X11Extras.so wayland-decoration-client
libicuuc.so.56 libQt5QuickControls2.so.5.12.9 libQt5X11Extras.so.5 wayland-graphics-integration-client
libicuuc.so.56.1 libQt5Quick.so libQt5X11Extras.so.5.12 wayland-graphics-integration-server
libmpg123.so libQt5Quick.so.5 libQt5X11Extras.so.5.12.9 wayland-shell-integration
libQt5Core.so libQt5Quick.so.5.12 libQt5XcbQpa.so wr_ding.pcm
libQt5Core.so.5 libQt5Quick.so.5.12.9 libQt5XcbQpa.so.5 xcbglintegrations
libQt5Core.so.5.12 libQt5QuickTemplates2.so libQt5XcbQpa.so.5.12 zoom
libQt5Core.so.5.12.9 libQt5QuickTemplates2.so.5 libQt5XcbQpa.so.5.12.9 ZoomLauncher
libQt5DBus.so libQt5QuickTemplates2.so.5.12 libquazip.so zopen
As you can see, a lot of the filenames start with libQt5 or Qt, so I would assume, that the framework used to develop the Linux desktop client is the Qt Framework. And because the Linux client and the Windows client share the same user interface, they are probably both using Qt.

OpenDDS - Solution builds fine, examples run, but IDL exes crash

I have successfully built OpenDDS 3.13.2 from source. Here is my environment:
Windows 10
Visual Studio 2017 (re-targeted Solution to SDK 10.0.17763.0)
Tried all Configuration/Platform combinations
I successfully used the configure script from the VS command prompt, built everything by opening the generated solution in the same command prompt, and finally ran the Messenger example (publisher and subscriber), and even configured it to use RTPS successfully.
However, when I try to create my own IDL and use the tao_idl, it crashes. Here's my test (using the proper environment from setenv.cmd):
> tao_idl (no args)
IDL: No input files
Second test:
> tao_idl Test.idl (crashes)
I get no error message, and am unable to locate logs or any indication of what went wrong. The same thing happens when I used opendds_idl.
What is the best approach to debug this, and/or are there pre-built binaries available for the IDL compiler(s) (both TAO and OpenDDS)?
After about a day of troubleshooting, I have determined a solution. Despite being able to call tao_idl and opendds_idl yourself, you should basically never do it. There are a good amount of command-line arguments needed to get both to work, and if they're not present, each exe will crash without the proper reasoning why.
I will add my steps below to create a new basic two-exe pub/sub project using OpenDDS:
Create your own IDL file.
Starting with the DCPS Messenger example, modify the .mpc file, replacing Messenger.idl with your IDL file name.
Create a new file called <your project>.mwc, and add the following contents:
workspace {
// the -relative and -include cmdlines make it so this workspace
// does not have to be in the $DDS_ROOT directory tree.
// tell MPC to substitute our DDS_ROOT environment variables for relative paths
cmdline += -relative DDS_ROOT=$DDS_ROOT
// tell the projects where to find the DDS base projects (*.mpb)
cmdline += -include $DDS_ROOT/MPC/config
}
Open a new VS command-line terminal and run $DDS_ROOT/setenv.cmd, or open a regular terminal if you have those environment variables set via Windows settings.
Navigate to your project directory and call: mwc.pl -type vs2017, replacing "vs2017" as needed for your build tool/IDE.
Open up the generated solution, and retarget it as necessary for your Windows SDK version.
Build the <your project>_IDL project first. If you notice in the output window, it is invoking the tao_idl and opendds_idl commands automatically. You can view the .vcxproj files to see the full command-line arguments that were the original problem.
Modify the publisher.cpp, subscriber.cpp, and DataReaderListenerImpl.cpp files to match your new IDL. Run the example as usual and ta-da!
For completeness, the full commands for both tao_idl and opendds_idl are as follows:
> opendds_idl -Sa -St "<your file>.idl"
> tao_idl -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -Sa -St -I$(DDS_ROOT) "<your file>.idl"
> tao_idl -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -Sa -St -I$(DDS_ROOT) "<your file>TypeSupport.idl"

arduino.h: 48:17: fatal error: sam.h: No such file or directory

I am trying to compile a simple new project ('hello') for the Arduino M0 Pro. I have created a new project in visual studio 2015 (using vMicro).
But I get the error:
hello.ino: In file included from
arduino.h: 48:17: fatal error: sam.h: No such file or directory
#include "sam.h"
compilation terminated
Through the Arduino IDE - board manager I have installed the cores for Arduino SAM Boards and SAMD Boards. Currently it is on Arduino IDE: v1.6.18, SAM: v1.6.11 and SAMD: v1.6.15 (the newest version at time of writing).
The strange thing is that I do see that the project has included this file, as it is shown in the file tree of External Dependencies, see screenshot.
file tree showing sam.h
I have also checked the include paths in the 'hello.vcxproj' file. I have cut out the list below:
<AdditionalIncludeDirectories>
$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\libraries
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.10\libraries
$(ProjectDir)..\libraries
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.10\cores\arduino
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.10\cores\arduino\avr
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.10\cores\arduino\USB
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.10\variants\arduino_mzero
$(ProjectDir)..\hello
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\CMSIS\Include\
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS-Atmel\1.0.0\CMSIS\Device\ATMEL\
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\arm-none-eabi
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\sys
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.10\system
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\avr
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\hardware\samd\usb
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\lib\gcc\arm-none-eabi\4.8.3\include
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\Device\ATMEL\samd21\include
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\CMSIS\include
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\Device\ATMEL\samd21\include\component
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\Device\ATMEL\samd21\include\instance
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\Device\ATMEL\samd21\include\pio
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.5.0\Device\ATMEL\samd21\include\component
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS-Atmel\1.0.0\CMSIS\Device\ATMEL\samd21\include
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\CMSIS\include
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\CMSIS-Atmel\1.0.0\CMSIS\Device\ATMEL\samd21\include\component
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\CMSIS-Atmel\1.0.0\CMSIS\Device\ATMEL\samd21\include\instance
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\CMSIS-Atmel\1.0.0\CMSIS\Device\ATMEL\samd21\include\pio
$(ProjectDir)..\..\..\AppData\Local\arduino15\packages\arduino\tools\CMSIS\CMSIS-Atmel\1.0.0\CMSIS\Device\ATMEL\samd21\include\component
%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
Even when I just open a completely new project in the Arduino IDE and try to compile it for Arduino M0, I get the exact same error!
I am stuck at this point. I've tried, as suggested at some other websites, de-installing SAM, de-installing SAMD, changing versions of either, but no luck.
In my case the specific solution was to delete the C:\Users[username]\AppData\Local\Arduino15 folder and reinstall the board packages I needed through the Arduino IDE Boards Manager.
Note this will not impact any libraries or other changes you have made in the IDE.

Atmel AVR Studio 6 using Arduino Uno (ATmega328p) and FreeRTOS

Hey there all,
I want to begin working with freeRTOS using my Arduino Uno which uses the ATmega328p on Atmel AVR Studio 6.
I am working on windows 7.
I went into this tutorial:
http://www.jayconsystems.com/tutorial/atmerpt1/
which describes how to install and prepare the Atmel AVR Studio 6 to work with ATmega328p.
I failed to understand what should I do in step 5A , which tells to do the following:
Go to Tools -> External Tools...
Create the new tool with these settings:
Title: Serial Program
Command: C:\arduino-1.0.1\hardware\tools\avr\bin\avrdude.exe
(Change that to match your arduino installation folder and locate avrdude.exe)
-CC:\arduino-1.0.1\hardware\tools\avr\etc\avrdude.conf -patmega328p -carduino -P\.\COM3 -b57600 -Uflash:w:"$(ProjectDir)Debug\$(ItemFileName).hex":i // *
NOTE: I do have the avrdude.exe installed on my computer at this location:
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe
So my questions are:
1) On the line * , what does -CC mean, does it needs to be within the arguments or the initial directory (within the External Tools dialog box)?
2) As it is mentioned , the path to the avrdude.conf (indeed in my case) goes through the X86 folder , so how does the line I need to enter there should be (cause it is mentioned there something about double quotes)?
3) After I will solve all of these problems how/where/does AVR Studio 6 has a "simple generic template" project to get started with freeRTOS ?
I ran into this tutorial (which uses different board) , can I "follow" it although I am using another board (my ATmega328p)?
Thanks allot in advance,
Guy.
1) -C is an option to the avrdude executable to specify the configuration file. The second C is part of the filename: C:\.
2) If the path to the configuration file has a space in the name, then it will get messed up when passed as an option to avrdude.exe. (The path will end with the space, and the rest will be junk that causes the command to fail.)
To get around spaces in a string, surround the string with quotes.
-C"C:\a directory with spaces\a filename with spaces in it.conf"
3) is beyond the scope of Stack Overflow (recommending a tool or resource.)

Windows 8 driver install and catalog/signature validation

I can't get windows 8 (release preview) to accept either the inf2cat or makecat approach described as solutions to the question at
What changed in the driver signature requirements for Windows 8?
unless I disable validation.
I am not signing these with any certificates at this point, just trying to get past the errors preventing the drivers from installing at all.
Windows 8 gives me a very nondescript error:
"A problem was encountered while attempting to add the driver to the store."
Looking in the event logs, there is nothing of use; only an informational entry from "Windows Error Reporting" indicating a PnPdriverimporterror.
When i use my original files with the cab files that don't match the inf, I get the error everyone else is listing:
The hash for the file is not present in the specified catalog file.
I have one .inf file that i need to generate a .cat for.
Perhaps I am doing something wrong. Ideas??
INF2CAT Approach
c:\win_xp_vista32_64>inf2cat /driver:"." /os:XP_X86,XP_x64,Vista_X86,Vista_x64,7_X86,7_X64,8_X86,8_X64
.......................
Signability test complete.
Errors:
None
Warnings:
22.9.10: usbser.sys in [drivercopyfiles.nt] is missing from [SourceDisksFiles] s
ection in \mchpcdc.inf; ok if file source is provided via LayoutFile in [Version
].
22.9.10: %driverfilename%.sys in [drivercopyfiles.ntamd64] is missing from [Sour
ceDisksFiles] section in \mchpcdc.inf; ok if file source is provided via LayoutF
ile in [Version].
Catalog generation complete.
c:\win_xp_vista32_64\mchpcdc.cat
MAKECAT approach
--- start of catalog.cdf file---
[CatalogHeader]
Name=mchpcdc.cat
ResultDir=.\
[CatalogFiles]
<hash>mchpcdc=.\mchpcdc.inf
---end of .cdf file ---
c:\win_xp_vista32_64>makecat catalog.cdf
These same files, w/ the cat from either approach install just fine in Windows 7.
I think this problem is to do with "windows driver signing enforcement". You can resolve this by disabling this option. Go through with below link:
http://tivadj-tech.blogspot.in/2012/09/certificate-check-error-when-installing.html
I just tested this on Windows 10 and 8 PRO now, to get this right, follow these steps:
1) From your Start menu, locate your DDK's "x64 Checked Build Environment" i.e. the custom DOS build screen. Right-click, run-as administrator...
2) Compile your source with the Build tools etc.
3) Go into your compiled code, and then create your test-certificate (you don't need to purchase one just yet, use your self-signed one created with the line below):
makecert -r -pe -ss PrivateCertStore -n CN=newhex.com(Test) NewhexTest.cer
The above means your certificate is called "newhex.com(Test)" and the generated file is "NewhexTest.cer"
4) Create / Edit your .CDF file which contains items about what your CAT file's contents.
5) Create your CAT file by executing:
makecat -v MyCDF.CDF
This should generate an un-signed CAT file that includes all files specified by your CDF.
6) Sign your CAT file as follows:
Signtool sign /v /s PrivateCertStore /n newhex.com(test) /t http://timestamp.verisign.com/scripts/timestamp.dll MyDriverWhatever.cat
This should result in a CAT file that is signed, but don't just install it, because your Windows can't trust Newhex's cert since it's not in the keystore, to fix this do:
7) Add your certificate to your private Key Store, remember this step MUST be done by an administrators access, otherwise you will get an error about (Keystore not found etc):
certmgr.exe -add NewhexTest.cer -s -r localMachine root
This should add into your keystore, Once done, you can then:
8) Go into your device manager, and add your new driver, you would get a warning but will be accepted and installed without the need to reboot with a forced (Don't check cert type account).
I tried this already and it works on Windows 10 and Windows 8 pro versions.
Kind Regards
Heider Sati
You are supposed to use inf2cat, not makecat, because you have an INF file.
You should work on addressing those warnings from inf2cat by fixing your INF file. Here is my INF file that uses usbser.sys and doesn't cause any warnings: https://gist.github.com/3647208
I was able to fix my INF file thanks to the advice from chinzei in the first post of this thread: http://www.microchip.com/forums/m488342-print.aspx
If you continue to have trouble, please edit your question to include the source of your INF file, or at least a link to the source.
I encounter the same problem and was able to install my driver with a TEST certificate using the instructions provided here:
http://msdn.microsoft.com/en-us/windows/hardware/gg487328.aspx

Resources