AVR / Arduino GUI Package for Lazarus lazarus / 78-Embedded - AVR ---------------------------------------------------------------------- Mathias · 2020-02-19 12:50 I now officially present my component, with which you can very easily create an Arduino / AVR project. To install the component, as usual with components, simply open via "Package -> Package file (* .lpk) ..." Then select "Use -> Install", then confirm the dialog with [Yes]. An "Arduino AVR Project" can then be created via "File -> New ... -> Project -> AVR Project (Arduino)". If you want to change something at runtime, you can edit the values ​​via "Project -> AVR Options". The AVR5 family is currently supported. This applies above all to the popular ATmega and the Arduino Uno & Nano. With the button template, you can directly select the parameters for common Arduino / AVR. The prerequisite that everything runs is a functioning cross compiler. How this works, everything is described here: https://wiki.freepascal.org/AVR_Embedded_Tutorial/de Download the package: https://github.com/sechshelme/Lazarus- Embedded/tree/master/Lazarus_Arduino_AVR_GUI_Package I am always welcome for feedback. : Wink: Especially when someone tests it on Windows. ---------------------------------------------------------------------- ccrause · 2020-02-19 19:15 Good work! ---------------------------------------------------------------------- BlueIcaro · 2020-02-19 19:35 Nice work, but link to wiki doesn't work. /BlueIcaro ---------------------------------------------------------------------- af0815 · 2020-02-20 05:31 I think this link https://wiki.freepascal.org/AVR_Embedded_Tutorial_- _Entry_Lazarus_and_Arduino/de (German original) https://wiki.freepascal.org/AVR_Embedded_Tutorial_- _Entry_Lazarus_and_Arduino (Translated english) was shortend. I known this very interesting articles were written first in german and then translated to other languages, so the german are the leading articles if something is not finished in english. Thanks to trev for his translation. ---------------------------------------------------------------------- Mathias · 2020-02-20 16:14 Thanks for the feedback Quote from: BlueIcaro on February 19, 2020, 08:35:31 pmNice work, but link to wiki doesn't work. /BlueIcaro I corrected the links, they were somehow destroyed in the forum. ---------------------------------------------------------------------- Mathias · 2020-03-13 15:15 Now it is also possible to select ARM types. This also includes STM32. As always, I am grateful for mistakes and suggestions. ---------------------------------------------------------------------- avra · 2020-03-13 16:46 Things are getting better and better ---------------------------------------------------------------------- Mathias · 2020-03-15 16:23 Since the fpc sources (cpuinfo.pas) contain data on memory size, etc., I have installed an info box. First for the AVR and this with a simple TMemo. For this I have installed a button "CPU Info ...".o. ---------------------------------------------------------------------- Mathias · 2020-04-12 12:04 I added a serial monitor to the package. But is still in the alpha stage. With "/dev/ ttyUSB0" and 9600 baud it already works. ---------------------------------------------------------------------- d.ioannidis · 2020-04-12 13:44 Hi, Quote from: Mathias on April 12, 2020, 02:04:41 pmI added a serial monitor to the package. < snip > I don't know your Roadmap but I think that we're having the same goal regarding Lazarus IDE Serial Monitoring feature . What do you think about working together for this feature of your project ? regards, ---------------------------------------------------------------------- Mathias · 2020-04-13 14:10 I just saw that you also have something similar in mind. https://github.com/dioannidis/lazserialmonitor I have read something that you can interrupt the serial monitor when uploading to the AVR and then start it again, as Arduino and sloeber - IDE can. You are welcome to browse through my sources. https://github.com/sechshelme/Lazarus-Embedded We can already exchange ideas, only the biggest problem, I can not speak English, I have to translate everything with Google. Addendum: For the serial monitor, I copied and modified the unit synaser.pas from the package synapse. So it is no longer necessary to install the Packge synapse. ---------------------------------------------------------------------- Mathias · 2020-04-14 14:59 @Dimitrios Chr. Ioannidis In your project I found lines that take me a lot further. Interrupt the Com-Port when uploading and then open it again. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TLSW.DoOpen;begin  ShowMessage('Serial Öffnen');//  if Assigned(SerialMonitor) then//    SerialMonitor.RequestActiva]"]>Blockednitor(True);end; procedure TLSW.DoClose;begin  ShowMessage('Serial Schliessen');//  if Assigned(SerialMonitor) then//    SerialMonitor.RequestActiva]"]>Blockednitor(False);end; ....  // Run ( without or with debugger ) hooks  LazarusIDE.AddHandlerOnRunDebug(@LSW.RunHandler);  LazarusIDE.AddHandlerOnRunWithoutDebugInit(@LSW.RunNoDebugHandler);  LazarusIDE.AddHandlerOnRunFinished(@LSW.StopHandler, True); Addendum: I completely did without Synaser in my project, I now use the Serial unit, which is part of Lazarus. ---------------------------------------------------------------------- d.ioannidis · 2020-04-14 15:46 Quote from: Mathias on April 14, 2020, 04:59:23 pmIn your project I found lines that take me a lot further. Interrupt the Com-Port when uploading and then open it again. Nice ! This was just a proof of concept. I'm glad that you find it useful. Quote from: Mathias on April 14, 2020, 04:59:23 pmI completely did without Synaser in my project, I now use the Serial unit, which is part of Lazarus. I don't know any Lazarus serial unit. Maybe you mean FPC's serial unit ? I'll wait until you commit the changes to your github repository. regards, ---------------------------------------------------------------------- Mathias · 2020-04-15 15:35 QuoteI don't know any Lazarus serial unit. Maybe you mean FPC's serial unit ?Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  Serial; QuoteI'll wait until you commit the changes to your github repository.https://github.com/sechshelme/Lazarus- Embedded/tree/master/Lazarus_Arduino_AVR_GUI_Package ---------------------------------------------------------------------- Mathias · 2020-04-17 15:13 Now the serial monitor window can be opened with Show instead of ShowModal. If the monitor is active and blocks the COM port. The monitor is automatically interrupted when a program is compiled. So the AVRDude has the COM port free. After uploading, the monitor becomes active again. Just as the Arduino IDE does. Can someone test under Windows? ---------------------------------------------------------------------- Mathias · 2020-05-01 15:01 The serial monitor has made great progress. WordWarp is (still) without function. If you feel like it, you can try it out. https://github.com/sechshelme/Lazarus- Embedded/tree/master/Lazarus_Arduino_AVR_GUI_Package ---------------------------------------------------------------------- Mathias · 2020-07-22 13:30 I released the tool as version 1.0.0. ---------------------------------------------------------------------- Mathias · 2020-08-05 11:28 Quote from: Mathias on April 14, 2020, 04:59:23 pm@Dimitrios Chr. Ioannidis In your project I found lines that take me a lot further. Interrupt the Com-Port when uploading and then open it again. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TLSW.DoOpen;begin  ShowMessage('Serial Öffnen');//  if Assigned(SerialMonitor) then//    SerialMonitor.RequestActiva]"]>Blockednitor(True);end; procedure TLSW.DoClose;begin  ShowMessage('Serial Schliessen');//  if Assigned(SerialMonitor) then//    SerialMonitor.RequestActiva]"]>Blockednitor(False);end; ....  // Run ( without or with debugger ) hooks  LazarusIDE.AddHandlerOnRunDebug(@LSW.RunHandler);  LazarusIDE.AddHandlerOnRunWithoutDebugInit(@LSW.RunNoDebugHandler);  LazarusIDE.AddHandlerOnRunFinished(@LSW.StopHandler, True); Addendum: I completely did without Synaser in my project, I now use the Serial unit, which is part of Lazarus. I have discovered another error regarding this stopping of the Com- Port. Overriding these functions is useless since they are only executed when avrdude is ready. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   // Useless  LazarusIDE.AddHandlerOnRunDebug(@NewIDEHandle.RunHandler, False);  LazarusIDE.AddHandlerOnRunWithoutDebugInit(@NewIDEHandle.RunN oDebugHandler, False);  LazarusIDE.AddHandlerOnRunFinished(@NewIDEHandle.StopHandler, True); [ You have to overwrite the following: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   // correct  LazarusIDE.AddHandlerOnProjectBuilding(@NewIDEHandle.RunBuilding, False);  LazarusIDE.AddHandlerOnProjectBuildingFinished(@NewIDEHandle. StopBuilding, True); ---------------------------------------------------------------------- d.ioannidis · 2020-08-05 13:00 Hi, Quote from: Mathias on August 05, 2020, 01:28:07 pm < sip> I have discovered another error regarding this stopping of the Com- Port. Overriding these functions is useless since they are only executed when avrdude is ready. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   // Useless  LazarusIDE.AddHandlerOnRunDebug(@NewIDEHandle.RunHandler, False);  LazarusIDE.AddHandlerOnRunWithoutDebugInit(@NewIDEHandle.RunN oDebugHandler, False);  LazarusIDE.AddHandlerOnRunFinished(@NewIDEHandle.StopHandler, True); [ You have to overwrite the following: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   // correct  LazarusIDE.AddHandlerOnProjectBuilding(@NewIDEHandle.RunBuilding, False);  LazarusIDE.AddHandlerOnProjectBuildingFinished(@NewIDEHandle. StopBuilding, True); it's not an error Mathias. The lazserialmonitor at github,  is a proof of concept showing that you can override some IDE handlers depending on the situation and the functionality you want. Also you can see at "Added handlers for project build." commit from April 25, that I added those build handlers . regards, ---------------------------------------------------------------------- Mathias · 2020-08-06 13:50 I probably caught an older version of you there. The building was not yet overwritten there. For what do you still have the open and close in the handle? For me this was useless.