Re: [fpc-pascal] 64-bit ARM and CPUARM
On Tue, May 21, 2024 at 10:37 AM Ched via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > In https://www.freepascal.org/docs-html/prog/progap7.html , there is > specified that > CPUARM Free Pascal target is an ARM 32-bit processor. > > What about ARM 64-bit processors like the ones in Raspberries ? > Something similar to CPUPOWERPC with two subcatagories CPUPOWERPC32 and > CPUPOWERPC64 ? > > ARM-64 is called aarch64 in FPC, so the define should be something like CPUAARCH64 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Forking the GitLab FPC Source repository
On Mon, May 1, 2023 at 4:24 PM Norman Dunbar via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > On 30/04/2023 16:59, Michael Van Canneyt via fpc-pascal wrote: > > > The repo is not private. > Ok, thanks. my assumption was obviously incorrect then. > > > > One possible reason is that the repo is simply too big: it has 26 years > of > > commits. > > > > We had serious problems importing it for this very reason. > Again, thanks. I'll attempt a different method. > FWIW, there are currently 68 forks of the FPC source repository on GitLab. I forked the repository shortly after it was created, at the time there were no issues. I do not expect the size of the repository to be a problem when creating a fork, there is probably some GitLab related issue. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] IRC channel for FreePascal support ?
On Thu, Apr 13, 2023 at 11:39 AM Tomas Hajny via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > On 2023-04-13 11:23, Jacob Kroon via fpc-pascal wrote: > > > Hi Jacob, > > . > . > > Ok, maybe this "Joanna" is on this mailing list and would care to > > elaborate more why I got banned ? > > > > The same "Joanna" also kicked me out of the channel a couple of days > > ago with the reason that "we don't allow lurkers", since I was > > inactive in the chat. > > Just FYI - I don't see anybody having name "Joanna" among people > subscribed to this mailing list, and nobody like that has been > considerably active here in the last years as far as my memory serves > correctly. Obviously, the address and/or name may be completely > different from the IRC nickname, thus it doesn't mean that you wouldn't > get the response here for sure. I can't check the list of people > subscribed to FPC forum, the person may be active there. > > Tomas > (one of FPC mailing list moderators) > Most probably user Joanna on the Lazarus/FPC forum: https://forum.lazarus.freepascal.org/index.php?action=profile;area=summary;u=64282 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
On Wed, Apr 5, 2023 at 12:43 PM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > On Wed, 5 Apr 2023 11:40:09 +0200, Christo Crause via fpc-pascal > wrote: > >Looking at the datasheet for CAT24C128, Fig. 6 Byte Write Sequence, shows > >no repeated start condition between register address and data bytes. I > >suspect that the second i2c message should contain the I2C_M_NOSTART flag, > >else the address and data parts of the transaction will be separated by a > >repeated start signal. I have modified the WriteBytesToReg methods in > >i2c.pas, please feel free to pull from Github and test this again. > I tested the i2c code with a PCA9685 IC. It also supports multi-byte writes, although it only has 8 bit register addresses. I realised that my original code used two i2c transactions and that each transaction starts with sending the device address. The multibyte write obviously doesn't work like this, so I changed the WriteBytesToReg methods (in i2c.pas) to combine the register address and data into one buffer, which is then transmitted using the WriteBytes method. This was tested and confirmed when writing 4 bytes to sequential registers to a PCA9685 IC with the new WriteBytesToReg method ( https://github.com/ccrause/rpiplc_pas/blob/dc568bbfba2cda50f7ba394469480109e652247d/native/pwm_pca9685.pas#L227 ). Only the WriteBytesToReg for 16 bit register addresses are now untested, although it follows a similar pattern so I have a reasonable expectation that it should work. If this update still doesn't work, I will need a logic analyser trace of an i2c write transaction that is successful (say using i2ctrace) and one which is unsuccessful using TI2cMaster.WriteBytesToReg. Or I need to find a similar EEPROM to test... Thanks, I did so and used it in my code but it still does not write the > EEPROM... > > Here is the code I use to test (in a command line program), maybe you can > see a > usage problem? > > var > i2cbus, > dev_addr, > reg_addr, > data_cnt: integer; > indata: TBytes; > > procedure main_12c_write(); //This is the main application procedure > var > i: integer; > num: uint16; > i2cEeprom: TI2c_eeprom; > begin > processInputs; //Read command line and write to variables > //Now process the data towards the EEPROM > i2cEeprom := TI2c_eeprom.Create; //Defaults are set for my EEPROM > try > num := i2cEeprom.WriteData(reg_addr, data_cnt, indata); > Writeln('Wrote ' + IntToStr(num) + ' bytes to address $' + > IntToHex(reg_addr,4) ); > finally > i2cEeprom.Free; > end; > > function TI2c_eeprom.WriteData(StartAddress, NumBytes: uint16; Source: > TBytes): > uint16; > var > endpos, capacity, addr: uint16; > i2cMaster: TI2cMaster; > i2cbus: TI2CBus; > sourcelen, i, j: integer; > pSource: PByte; > begin > Result := 0; > //Check valid indata: > //snip > //Prepare the handler for action... > i2cbus := TI2CBus(FI2cBusNo); > i2cMaster := TI2cMaster.Create; > try > if not i2cMaster.Initialize(i2cbus) then > begin > writeln('Error opening i2c device: ', FI2cBusNo); > exit; > end; > > //Check if data will fit into a single page start at given address: > if ((StartAddress and $ffc0) = (endpos and $ffc0)) then //Fits in page > begin > //Perform a single write cycle into the buffer > pSource := @source[0]; > if not i2cMaster.WriteBytesToReg(FEEPROMAddr, startaddress, pSource, > NumBytes) then > begin > Writeln('Error: Could not write to I2C device!'); > exit; > end > else > Result := NumBytes; > end > else //We need to split data over several commands > begin > Writeln('Not yet implmented data split into several writes'); > end; > finally > i2cMaster.Free; > end; > The use of WriteBytesToReg in the TI2c_eeprom.WriteData method seems fine, perhaps retest with the updated WriteBytesToReg method. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
On Wed, Apr 5, 2023 at 11:22 AM Jean SUZINEAU via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > May be you could get the source code of i2ctransfer from i2c-tools and > compare it with the code in i2c.pas ? > Good idea, that led to the suggestion to try the WriteBytes method which is similar to how i2ctransfer constructed the i2c transaction. Hopefully the change to the WriteBytesToReg methods also fixes the original problem, since it is a little bit more convenient to work with. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
On Wed, Apr 5, 2023 at 7:55 AM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > On Wed, 05 Apr 2023 00:33:50 +0200, Bo Berglund via fpc-pascal > > I *can* write a sequence of bytes into the EEPROM succsessfully using an > i2c-tools command like this: > > i2ctransfer -y 1 w18@0x50 0x00 0x38 0x00 0x01 0x02 0x03 0x04 0x05 0x06 > 0x07 0x08 > 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f > > This writes data starting towards the end of the page and wraps around > such that > part of the data gets to the start of the page. > Looking at the i2ctransmit transaction data: $ i2ctransfer 1 w18@0x50 0x00 0x38 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f WARNING! This program can confuse your I2C bus, cause data loss and worse! I will send the following messages to device file /dev/i2c-1: msg 0: addr 0x50, write, len 18, buf 0x00 0x38 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f This can be simulated by calling the WriteBytes method, see new example: https://github.com/ccrause/rpiplc_pas/blob/main/native/examples/i2c_write_test.lpr It shows: > - It is possible to write the data in one go > - If the data length is past the end of the page it wraps around to the > beginning > > So if the problem cannot be solved then I could either use the loop with > delay > or call the i2c-tools command i2ctransfer as a TProcess execution to write > multiple bytes in one command. > > But I would rather not use the TProcess method at all since it relies on an > external tool being present and the argument list can be pretty long and > tedious > to build... > Looking at the datasheet for CAT24C128, Fig. 6 Byte Write Sequence, shows no repeated start condition between register address and data bytes. I suspect that the second i2c message should contain the I2C_M_NOSTART flag, else the address and data parts of the transaction will be separated by a repeated start signal. I have modified the WriteBytesToReg methods in i2c.pas, please feel free to pull from Github and test this again. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
See comments below. On Tue, Apr 4, 2023 at 6:52 PM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I use the method: > > i2cMaster.WriteBytesToReg(i2caddress: byte; regAddress: uint16; data: > PByte; > size: byte): boolean;) > > With data specified as follows in the call: > > if not i2cMaster.WriteBytesToReg(FEEPROMAddr, startaddress, @source[0], > NumBytes) then > > Here the source argument is a TBytes array of bytes so I supply the > address of > element 0 as the data argument (expected to be a PByte). > This is the correct way of passing the starting address of your data buffer. Is your startaddress variable an unsigned 16 bit integer (word/uint16)? If not, type cast this to a uint16 to ensure the compiler calls the correct overloaded method. > When I step through this in the debugger and get into the method itself I > can > see that the source argument contains the data I have loaded into it, so > the > data is there. > > When I run that method to the end and it finishes without error, I still > cannot > see the data in the EEPROM at the given address. > > So for testing I changed the call to be: > if not i2cMaster.WriteByteToReg(FEEPROMAddr, startaddress, source[0]) then > > This uses the method to write a single byte to the i2c device and it works > just > fine! > > So either there is a problem with the WriteBytesToReg() method or else my > use of > it... > Note that I haven't tested WriteByteToReg with a device supporting 10 bit register addresses, or in your case 16 bit... > What comes to mind is the data type PByte, which I have never used before > and do > not know if it is valid. > PByte is a pointer to a byte. > I am keeping the data in a dynamic array of bytes (the pascal type TBytes) > and > send the address of element 0 of that array as the argument to the method. > Is this wrong? > Passing the address of the first element of a TBytes array as you did above is correct. If so what should I use instead? > Can I typecast it like this: > > if not i2cMaster.WriteBytesToReg(FEEPROMAddr, startaddress, PByte(source), > NumBytes) then > (Tried it and it does not work) > No, this does not take the address of source, which is waht is required. > > > Seems like I am getting close but missing something important... > I will look at the EEPROM datasheet, in case the details do not agree with the WriteBytesToReg implementation. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
On Sun, Apr 2, 2023 at 9:30 PM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Is there a reason that there is no i2c_write_reg demo in the github > package? > I haven't gotten round to that, waiting for hardware to test the code with. I will try to write one so I can test that as well... > Would be nice if you could share that :-) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
On Sat, Apr 1, 2023 at 9:57 PM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Question: > Can I use Linux file system commands to read/write the data on the i2c > EEPROM > memory device and if so how from fpc? > To some extent it is possible to handle i2c transactions as file read/write operations, but some ioctl calls are required to configure e.g. the device address [1]. Take note that only a subset of i2c functionality is available using read/write calls. Lazi2cdev [2] uses this approach. For finer control over the i2c transactions (for example combined write/read transactions) low level ioctl calls are available in Linux. I wrote an i2c class [3] using this approach. 1. https://www.kernel.org/doc/html/latest/i2c/dev-interface.html 2. https://github.com/laz2wiringpi/lazI2cdev/blob/master/i2cdev_base.pas 2. https://github.com/ccrause/rpiplc_pas/blob/main/native/i2c.pas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Working on a new way to educate people about pascal
On Tue, Dec 27, 2022 at 6:47 PM Anthony Walter via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > My idea is to implement a web page system where syntax highlight code is > presented like in the Lazarus IDE, and special links are peppered through > and explanation of how and why Pascal works by using some example programs. > When the user highlights the special link, the relevant source code is > highlighted in the syntax window. This then hopefully allows people to > understand a bit more about pascal by pairing the explanations with lines > of source code. > > Let me know if you think this approach has any merit or if you think my > guide could be altered to be a bit more clean in places. As a reminder, > this page is a wiki, so you cna submit edits to me by clicking the edit > link at the top of the page. I am able to see and merge your edits. > I like the concept implemented in this guide. A small problem I noticed is when the source code snippet linked to is not visible, clicking the link does not move the code snippet into view. This is obviously a tricky situation since moving the code into view may require shifting the rest of the document, which may not be desirable. Explaining the layout and structure of a Pascal program using an example is a good idea. However, the example topic is quite advanced so a non-programmer would probably be completely lost regarding the purpose of the code itself. Programmers from other languages may also not understand the concept of a form or the Application instance. As suggested, perhaps the example itself should be simple enough so that a non-programmer can understand the intention of the code. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] [Question] How to submit our patch?
On Mon, Oct 10, 2022 at 11:47 AM Jinyang He via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > We, a team working for Loongson, are ready to submit some patches which > support a new architecture named LoongArch for FreePascal. [1] is one of > repositories about LoongArch. LoongArch is a RISC architecture. The work > of Loongson was based on MIPS in the past. So LoongArch is somewhat > similar to MIPS. Of course, there are also commonalities with other RISC > architectures such as aarch64, riscv, etc. Patches that support LoongArch > also refer to many other architectures. I have to show my respect to the > others who contributed FreePascal. > > Which way can we submit these patches? I guess we should create a > 'merge requests' in Gitlab. Is it correct? I hope to find some official > documentation, or some discussion from the list. All answers are > needed. Thanks. > > [1] https://github.com/loongson Thank you for offering patches to support LoongArch in FPC. Also send this message to the FPC developers' mailing list ( fpc-de...@lists.freepascal.org), not all the compiler developers may be monitoring this list. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] SerReadTimeout question
On Mon, Sep 19, 2022 at 7:51 AM Christo Crause wrote: > > > On Mon, 19 Sep 2022, 03:18 James Richters via fpc-pascal, < > fpc-pascal@lists.freepascal.org> wrote: > >> I can't seem to find any documentation or SerRead or SerReadTimeout.. >> searching for either along with Freepascal doesn't get me any results. >> If it exists somewhere and I am just missing it, can someone tell me where >> it is? >> >> Anyway, what I'm trying to figure out is when the timeout timer starts... >> > > FPC uses the OS provided functionality to interact with the serial port. > On Windows the timeout seems to start when the read request is made ( > https://learn.microsoft.com/en-us/previous-versions/ff547486(v=vs.85)). > On POSIX (at least Linux) it depends on the specific set of flags specified > , scroll down to the discussion on canonical/noncanonical mode for the > details (https://linux.die.net/man/3/termios). > A bit more information after peeking into the source code: on win32 the timeout information can be read or set using Get/SetCommTimeouts. The COMMTIMEOUTS structure ( https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-commtimeouts) contains a read interval timeout and total timeouts for read & write operations. SerReadTimeout sets the ReadTotalTimeoutConstant value, so basically the total timeout duration. On Linux SerReadTimeout uses a fpSelect on the handle with the specified timeout, so in principle it is the same behaviour as on Windows, i.e. a total timeout. While both OSs provide some functionality to specify inter character timeouts, FPC does not directly expose this functionality in the Serial unit. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] SerReadTimeout question
On Mon, 19 Sep 2022, 03:18 James Richters via fpc-pascal, < fpc-pascal@lists.freepascal.org> wrote: > I can't seem to find any documentation or SerRead or SerReadTimeout.. > searching for either along with Freepascal doesn't get me any results. > If it exists somewhere and I am just missing it, can someone tell me where > it is? > > Anyway, what I'm trying to figure out is when the timeout timer starts... > FPC uses the OS provided functionality to interact with the serial port. On Windows the timeout seems to start when the read request is made ( https://learn.microsoft.com/en-us/previous-versions/ff547486(v=vs.85)). On POSIX (at least Linux) it depends on the specific set of flags specified , scroll down to the discussion on canonical/noncanonical mode for the details (https://linux.die.net/man/3/termios). > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Test Free Pascal program not compiling
On Mon, 12 Sep 2022, 02:59 Terry A. Haimann via fpc-pascal, < fpc-pascal@lists.freepascal.org> wrote: > Trying to compile a small test pascal program on a arm cpu. I beleive > it is an a53. Libre Le Potato > > I am getting the following error: > > Error: Error while assembling exitcode 1 > > Thanks in advance, > > Terry H. > Enable the compiler's verbose mode (-va). The real error is sometimes printed much earlier in the compiler output. > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC Backtrace
On Mon, Jan 3, 2022 at 3:28 PM James Richters via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I’m curious if there is some way, perhaps with some directive or something > to force a debug backtrace to happen, but without an error > Try calling Dump_Stack in your code: https://freepascal.org/docs-html/rtl/system/dump_stack.html ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Keeping current with FPC Source on gitlab
On Sat, 6 Nov 2021, 02:09 James Richters via fpc-pascal, < fpc-pascal@lists.freepascal.org> wrote: > Do I need to use the source to re-install FPC every time I want to update > it? If so how is this accomplished? > > Or is there a better way to just update everything when I update the > repository without re-installing it? > To build the compiler, rtl and packages from newly updated source, call make clean all from the base folder of the source containing the compiler, rtl etc folders. This will produce a new compiler located in the compiler folder. It will be called something like ppcx64 (depends on your host architecture). Compiled units for rtl are located in rtl/units/$fpctarget and packages will sit under packages/*/units/$fpctarget. a) You can use this as is without installing, but then your config file needs to be updated with the relevant locations to units and utilities. Either call ppcx64 (or your target compiler) directly, or build the fpc frontend located in compiler/utils, then copy the resulting fpc executable into the compiler folder from where it can call the target specific executables. Since this folder layout is most likely different from the installed layout, use a different fpc.cfg file with paths updated according to the source structure. b) You can install the new compiler (make install), which would typically overwrite the existing installed version. Or you can install to a custom location by specifying INSTALL_PREFIX=path/to/install/folder. You need the previous stable compiler to start the build process, so do not overwrite the installed version. This also requires a custom fpc.cfg, since the base folder will be different to the installed path. For either of the options, call the compiler with the option -n to not load the default config file (which would point to the installed version, leading to unit version conflicts) and @/path/to/new/fpc.cfg so that the compiler can load the new config. Notes 1. I'm using Linux conventions above, translate path separators and .exe extensions as required for Windows. 2. If the stable compiler is not in the path, add FPC=path/to/compiler/ppcx64 to the make commands. 3. There are many more permutations I'm sure, these are just the options I've managed to get working. As Ryan mentioned, you have to frequently (if you want to stay up to date) update the source (git pull), then rebuild. So configuring your setup initially is key, after that it is relatively simple to stay up to date. On a personal note, I got tangled up with config files and conflicts between old and new compiler versions in the past. When you run into strange compiler errors about not finding units, or invalid PPU versions or some such, take note of the paths used for the compiler, config file and the relevant units. My strategy was to never install fpc into the search path, always specify the path to the compiler executable and know when the compiler should ignore the default and load a specific config file for the particular compiler. Alternatively use fpcupdeluxe, it has an option to checkout and build main. I haven't tested this much, since I'm comfortable with my workflow. There is an active thread on the Lazarus forum for fpcupdeluxe support. > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Conversion from C to Pascal - Left bit shift
On Fri, Sep 3, 2021 at 8:02 AM LacaK via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Can we say that in Pascal the result of: >E1 shl E2 > is of same type as E1 ? > (so if E1 is LongWord then result is LongWord also?) > > What if there is an expression on left side: >(E1*x) shl E2 > Will E1*x promote to 64 bits (on 64 bit target)? > See documentation on automatic type conversion (the remarks section below table 3.3): https://www.freepascal.org/docs-html/ref/refsu4.html#x26-26004r3 While this doesn't explicitly mention shift behaviour, it implies that E1 and (E1*x) will be promoted to native sized integer if smaller. For the first example, if E1 is a longword on a 32 bit machine, the result should also be a longword. Personal note: I find the naming of ordinal types confusing. Is shortint smaller than smallint, or smallint shorter than shortint? In FPC a word is 2 bytes in size, however on the hardware side a word refers to "the natural unit of data used by a particular processor design" ( https://en.wikipedia.org/wiki/Word_(computer_architecture)). I prefer to use the type aliases with explicit mention of size, such as int16, uint8 etc. I assume the flip side of this is when trying to write portable code that uses the most efficient size available on a target. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?
On Thu, Aug 12, 2021 at 7:34 AM LacaK via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > I have related question: in SVN was possible to checkout specific > sub-directory (for example if I am interested in fcl-db package only I > checkedout only this sub-directory). > Is it possible with gitlab? Or I must clone whole > https://gitlab.com/freepascal.org/fpc/source ? > There is a relatively new git feature "sparse-checkout" that could potentially be used in this case (I haven't tested this). See e.g. https://stackoverflow.com/a/60729017/13781629 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?
On Thu, Aug 12, 2021 at 12:50 AM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > On Wed, 11 Aug 2021 22:22:54 +0200 (CEST), Michael Van Canneyt via > fpc-pascal > wrote: > > ># Get sources > >git clone https://gitlab.com/freepascal.org/fpc/source.git $FPCVER > ># switch to branch/tag > >cd $FPCVER > >git checkout $FPCTAG > >cd .. > > How big a size is the git clone going to pull? > > By the looks of it I get the impression that the git clone will download > every > single tag/branch/commit etc ever done and then the git checkout activates > the > actual tagged file set? > If this is correct then the size on disk will be too big. > > Now as I said I have not used git and for my day use cannot switch because > we > use properties of svn that are simply not available in git... > To retrieve a specific branch without history (I think this is approximately equivalent to the svn co command) specify options --branch (to specify which branch to check out), --single-branch (to not pull in other branches) and --depth (to limit the history that git pulls in): git clone --depth=1 --branch fixes_3_2 --single-branch https://gitlab.com/freepascal.org/fpc/source.git fpc-fixes_3_2 This example downloads about 46 MiB of data, which expands to around 309 MiB on disk, of which 50 MiB is git information. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Interruption handling on i8086
On Sat, Apr 10, 2021 at 10:14 AM Guillermo via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Hi pascaloids, > > I'm doing DOS development for fun and, after installing the compiler > (was quite hard), I'm having problems handling interrupts. > > I started with keyboard and it doesn't work. The handler declaration: > > procedure DOS_KbdHandler; interrupt; > > but compiler says: > > keybrd.inc(14,29) Warning: Calling convention directive ignored: > "OldFPCCall" > This was fixed in trunk rev 39838 ( https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/compiler/pdecsub.pas?r1=39703=39838), but so far the fix didn't make it into a release yet. At least for AVR the warning can be ignored. Not sure why your code doesn't work properly on i8086 though. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Questions from Semi-Beginner
On Sat, Feb 20, 2021 at 10:48 AM CSlemaker via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Title: OS Upgrade Windows 7 to Windows 10 – Free Pascal Consequences ? > > I am currently running under Windows 7 but I MUST upgrade to Windows 10 > Pro. > > Will I need to recompile my Pascal source files for object compatibility > with Win 10? > Should I install the latest version of Free Pascal, and if so, which > version is that? > Will I have any compatibility problems with my source codes and an > up-to-date compiler? > The change in Windows version should in principle (yes, famous last words) not impact on your legacy code. There may be edge cases where permission levels may change and prevent code from running. That said I don't program much on Windows. Perhaps a bigger factor will be the changes in compiler behaviour. The compiler team is serious about maintaining backwards compatibility, but there are some breaking changes (not much really), see the following links: https://wiki.freepascal.org/User_Changes_3.0 https://wiki.freepascal.org/User_Changes_3.2.0 > > P.S. - "Lazarus" is a term I'm not familiar with. Is it a completely new > IDE for Free >Pascal? Is there a document which describes differences with the old > IDE? >Is the old IDE still available in case I have trouble with Lazarus? > Lazarus is an independent IDE forFPC that has a graphical interface (a Delphi IDE clone, somewhat similar to Visual Studio), perhaps a richer feature set compared to FP and a visual form editor for visual editing of graphical forms ("windows"). You can install and test it in parallel to the old FP IDE, there isn't any interaction. If you don't like Lazarus you can continue working in FP. A couple of screen shots of Lazarus: https://wiki.lazarus.freepascal.org/Screenshots ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Value:x:y syntax
On Tue, Feb 9, 2021 at 2:11 PM Luis Henrique via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > At > https://lists.freepascal.org/pipermail/fpc-devel/2021-February/043569.html > I saw the syntax "value: x: y". > > str(value:6:3, valuestr); > What is the name of this and where is it documented? > I did tests and saw that Y determines the width of the precision part, but > I can't see any effect of X. > I guess one can call it optional formatting specifiers. See documentation: https://www.freepascal.org/docs-html/rtl/system/str.html ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] basic question on begin, end;
On Wed, Sep 23, 2020 at 4:25 PM dano none via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > end; > my_base := my_base + 15; > writeln('current base ',my_base:2); > ch := ReadKey; > { end; { end i = column indexer }} > A different way to explain Bart's comment is that the inner loop over j is a compound statement (between the inner loop begin/end block) which is followed by more statements (the statements after the first end quoted above). If you comment out the outer begin/end block these statements are not included in the execution of the outer loop, so for example my_base is not incremented as part of the outer loop if the begin/end pair is commented out as indicated in your example. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] bug tracker (bugs.freepascal.org) APPLICATION ERROR #400 (db connection failed)
On Sun, Aug 30, 2020 at 11:26 AM Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > On Sun, 30 Aug 2020, Christo Crause via fpc-pascal wrote: > > > On Sun, Aug 30, 2020 at 9:45 AM Dmitry Boyarintsev via fpc-pascal < > > fpc-pascal@lists.freepascal.org> wrote: > > > >> The site opens up with: > >> > >> APPLICATION ERROR #400 > >> > > > > I also get the above mentioned error when trying to open the website. > > The problem should be fixed. > I confirm the bug tracker is available again. Thank you Michael! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] bug tracker (bugs.freepascal.org) APPLICATION ERROR #400 (db connection failed)
On Sun, Aug 30, 2020 at 9:45 AM Dmitry Boyarintsev via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > The site opens up with: > > APPLICATION ERROR #400 > I also get the above mentioned error when trying to open the website. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using built-in serial instead of synaser and the like for Linux console app?
On Fri, Aug 21, 2020 at 12:05 PM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > So hence my question: > Is there something bad about serial (built-in to fpc) that makes it > unsuitable for use? > In my limited experience the FPC serial unit is a bit more low level than the components such as synaser etc. There is a bit more of a learning curve and one needs to decide whether to go blocking or not and how to handle async reads etc. I needed to use custom baud rates with auto baud for an application (debugwire-gdb-bridge) so I took the time to figure out some of the details. Since then I've re-used it in other serial based applications - once you get past the learning curve of how things fit together it is relatively easy (I guess like most things). I prefer it now because it reduces external dependencies in a project. > Seems like there are virtually no posts describing solutions using > serial... > Here is a unit showing how to open, read and write (blocking) using the serial unit: https://github.com/ccrause/debugwire-gdb-bridge/blob/master/serialutils.pas Unfortunately there is other code for sending a break command and setting custom baud rates which makes it appear more complicated than it should be. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpDebug function-call proof-of-concept
On Tue, 7 Jul 2020, 11:17 Joost van der Sluis, wrote: > Hi all, > > Last weekend I started on the ability to evaluate functions within > fpDebug. And I got quite far. It is a proof-of-concept, still needs a > lot of work. But it works! > Great news! I guess this is a step towards evaluating object properties via get methods? > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit
On Wed, May 13, 2020 at 9:31 AM Michael Van Canneyt wrote: > > On Wed, 13 May 2020, Christo Crause via fpc-pascal wrote: > > > On Tue, May 12, 2020 at 11:11 PM Noel Duffy via fpc-pascal < > > fpc-pascal@lists.freepascal.org> wrote: > > > >> Sure, I can do that. I will look at creating a patch for this. For your > >> purposes, do you prefer to have a new bug in the bug tracker opened for > >> tracking this change? > >> > > > > If your patch is related to an existing open bug report then keep > updates, > > discussions etc. under the same report, else the information gets > > fragmented. A reporter cannot delete his/her own old patches, so just > > append a version number to a new patch, if the patch completely replace a > > previous patch, and mention the changes/updates in a comment. In your > case > > something like StrToHostAddr6-v2.patch for an updated patch. > > That is correct if you want to fix a wrong patch. > > But not what you should do for this case, because there are 2 > issues: fix existing api, and extend the existing api (a refactor). > > So: separate reports, and if so desired add a link in 'related to'. > Apologies, I should probably only comment if I followed all the details of the discussion... ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit
On Tue, May 12, 2020 at 11:11 PM Noel Duffy via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Sure, I can do that. I will look at creating a patch for this. For your > purposes, do you prefer to have a new bug in the bug tracker opened for > tracking this change? > If your patch is related to an existing open bug report then keep updates, discussions etc. under the same report, else the information gets fragmented. A reporter cannot delete his/her own old patches, so just append a version number to a new patch, if the patch completely replace a previous patch, and mention the changes/updates in a comment. In your case something like StrToHostAddr6-v2.patch for an updated patch. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit
On Wed, May 6, 2020 at 12:19 PM Noel Duffy via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > So I guess the question is, is it worth the effort to make > StrToHostAddr6 RFC4291 compliant? Is that something the FPC team would > want, or do they just not use the sockets unit? > There have been 2 changes applied to sockets.inc in the last two months so it is not neglected. I am convinced a patch to ensure compliance will be considered for inclusion, especially if you provide test cases demonstrating shortcomings in the current implementation. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Pascal Language Server
On Thu, 23 Apr 2020, 21:43 Ryan Joseph via fpc-pascal, < fpc-pascal@lists.freepascal.org> wrote: > ok, did this and now getting: > > /Users/ryanjoseph/Developer/lazarus/components/lazdebuggergdbmi/gdbmidebugger.pp(63,16) > Fatal: (10022) Can't find unit PropEdits used by GDBMIDebugger > > svn up says "At revision 63051." > > Never an easy time building lazarus for me. :) > > Regards, > Ryan Joseph > I usually revert to brute force troubleshooting in these instances: pass - va to the compiler. A lot of information, but usually the problem is close to the end so scanning the output in reverse should often reveal what is wrong. > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] About fpc license.
On Fri, 10 Apr 2020, 05:09 fredvs via fpc-pascal, < fpc-pascal@lists.freepascal.org> wrote: > Hello. > > I have done a fork of fpc fixes_3_2 and made some modification of original > code. > > May I distribute the fpc binary of that patched version with the units > files, ready to use out-of-the-box? > In my opinion yes, but note I only represent my own opinion here. On a practical side, make sure that your users know they are downloading a custom patched version not supported by the fpc team. Must I add the source of the change done? > As a minimum clearly display a download link to the modified source in the download. Could be a separate text file in the download, perhaps listing the modifications and link to the source. I What I am not allowed to do? > Anything not permitted by fpc's licences :) > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to rebuild an fpc package
On Tue, Feb 11, 2020 at 4:57 PM Luis - SoftSAT Sistemas < l...@softsatsistemas.com.br> wrote: > > You are using relative paths in -Fu and your current folder is > c:\lazarus\fpc\3.0.4\source\packages\fcl-db, so > > -Fu../../rtl should expand to -Fuc:\lazarus\fpc\3.0.4\source\rtl - the > compiler is searching where it was told. > This is done by the make file that come with the package. > > > It may be easier to just specify the absolute path to the compiled RTL > units, for example: > > -Fuc:\lazarus\fpc\3.0.4\units\rtl\your-target > If i add this with `make OPT=-Fu` it advances to next error and > require another unit. > > >> C:/lazarus/fpc/3.0.4/bin/i386-win32/ppc386.exe fpmake.pp -n -Fu../../r > if i edit the make file and remove the "-n" flag it compiles the fpmake > but when fpmake is run its throws another error. > > Anyway, looks like there are some problem with the makefile or with > something else on my system. > I guess the problem is how to tell the make system when to use installed units and when to recompile units. Although it should be possible to figure out how to do this, I rather suggest an easier fix: just recompile everything with "make all install" from the base of the fpc source folder. This way the makefiles do all the tracking of where compiled units are. The few minutes this will take should be much less than the time spent trying to figure out how to fix your original problem. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to rebuild an fpc package
On Tue, Feb 11, 2020 at 3:23 PM Luis - SoftSAT Sistemas via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Looking at unit search path the compiler are looking at "sources" dir > instead of "units" dir with the compiled units and i dont know how to fix > this. > > C:\lazarus\fpc\3.0.4\source\packages\fcl-db>make all OPT=-vut > C:/lazarus/fpc/3.0.4/bin/i386-win32/ppc386.exe fpmake.pp -n -Fu../../r > tl -Fu../../packages/paszlib -Fu../../packages/fcl-process > -Fu../../packages/has > h -Fu../../packages/libtar -Fu../../packages/fpmkunit -vut > You are using relative paths in -Fu and your current folder is c:\lazarus\fpc\3.0.4\source\packages\fcl-db, so -Fu../../rtl should expand to -Fuc:\lazarus\fpc\3.0.4\source\rtl - the compiler is searching where it was told. It may be easier to just specify the absolute path to the compiled RTL units, for example: -Fuc:\lazarus\fpc\3.0.4\units\rtl\your-target ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Git mirror
On Tue, Oct 29, 2019 at 8:27 AM denisgolovan wrote: > Hi all > > Looks like Graeme's FPC git mirror stopped syncing with svn. > I've sent a private mail, but no response. > Could somebody help? > It appears that the last commit on svn was on the 27th ( https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/utils/?sortby=date=log) which is the same date as the last commit on Graeme's mirror ( https://github.com/graemeg/freepascal/commit/a1fd692f4f98e4889eb9ef333075a6c0f8dd0891). I thus don't think there is a sync problem. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC RGB+W LEDs
A user space library written in C: https://github.com/jgarff/rpi_ws281x On Thu, Oct 24, 2019 at 3:54 PM James Richters < ja...@productionautomation.net> wrote: > I'm thinking about making a controller for SK6812 Individually addressable > RGB+W Led strips, perhaps something I can run on a Raspberry Pi. I'm > curious if anyone has any example routines that do the output timing for > Individually addressable LED strips? > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] *etFTime -> File*etDate
On Sun, Oct 13, 2019 at 8:03 PM Ched < charles.edouard.des.vastes.vig...@gmail.com> wrote: > Hello, > > In https://www.freepascal.org/docs-html/rtl/sysutils/filenameroutines.html > , > > FileSetDate < > https://www.freepascal.org/docs-html/rtl/sysutils/filesetdate.html>Get > file dates should be > corrected to _S_et . > I don't see any mix-up of Get and Set on either the FileSetDate or FileGetDate pages at your link above. > Now, my real problem is that the following code is compiled when SYS is > not defined, and isn't when it > is, and I really don't know why. > > PROGRAM QQ; > { $DEFINE SYS} > USES > {$IFDEF SYS} >SYSUTILS; > {$ELSE} >DOS; > {$ENDIF} > VAR > FO: FILE OF DOUBLE; > L: LONGINT; > BEGIN > ASSIGN(FO, 'blabla.bin'); > RESET(FO); > {$IFDEF SYS} >L:=FILEGETDATE(FO); { Got File, expected LongInt } > {$ELSE} >GETFTIME(FO, L); > {$ENDIF} > CLOSE(FO); > END. > The file variable FO in your code should be declared as type THandle (which is an alias for LongInt) when you are using the SysUtils file handling routines. Take a look at the example at the bottom of FileCreate ( https://www.freepascal.org/docs-html/rtl/sysutils/filecreate.html) to see how to work with these routines. > Well, it appears that I prbably haven't fully understand the dos->sysutils > conversion. > You are mixing classic Pascal style file handling (Assign, Reset, Close) which isn't (AFAIK) Dos style, with an alternative file handling style defined in SysUtils. Cheers, Ched' > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Building complier fails in itolitlsreader.pas
On Wed, Oct 9, 2019 at 8:04 PM Ryan Joseph wrote: > Updated from svn just now (r43157) and tried to build but I get this > error. Pasted below is the source from itolitlsreader.pas and it appears > it’s totally mangled. Are other users seeing this also or did my SVN break > something? > > itolitlsreader.pas(385,24) Error: Identifier not found "Sta" > itolitlsreader.pas(385,48) Fatal: Syntax error, ";" expected but > "identifier UNKNOWN1" found > Fatal: Compilation aborted > > while ChunkIndex <> -1 do > begin > Chunk.Position:=0; > fStream.Position:= Sta unknown1 : dword; // > always -1 > nrblock: dword; // Number of blocks > treedepth : word; // The depth of the tree > of blocks (1 if no index blocks, 2 one level of index blocks, ...) > nrkeywords : dword; // number of keywords in > the file. > codepage : dword; // Windows code page > identifier (usually 1252 - Windows 3.1 US (ANSI)) > lcid : dword; // LCID from the HHP file. > ischm : dword; // 0 if this a BTREE and > is part of a CHW file, 1 if it is a BTree and is part of a CHI or CHM file > unknown2 : dword; // Unknown. Almost always > 10031. Also 66631 (accessib.chm, ieeula.chm, iesupp.chm, iexplore.chm, > msoe.chm, mstask.chm, ratings.chm, wab.chm). > unknown3 : dword; // unknown 0 > unknown4 : dword; // unknown 0 > unknown5 : dword; // unknown 0 > end; > PBTreeBlockHeader = ^TBtreeBlockHeader; > TBtreeBlockHeader = packed record > Length : word; // Length of free > space at the end of the block. > NumberOfEntries: word; // Number of entries > in the block. > IndexOfPrevBlock : dword; // Index of the > previous block. -1 if this is the first listing block. > IndexOfNextBlock : dword; // Index of the next > block. -1 if this is the last listing block. > end; > My guess is you have a corrupted file. According to the SVN info that file was last changed in 2013. Viewing the file via the online viewer shows nothing peculiar around line 385: https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/chm/src/itolitlsreader.pas?view=markup#l385. I have also updated via svn (r43158) and that came through good. It is busy building but no problems so far. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Illegal counter variable?
On Wed, Sep 11, 2019 at 7:06 AM Ralf Quint wrote: > On 9/10/2019 4:26 PM, wkitt...@windstream.net wrote: > > On 9/9/19 10:11 AM, James Richters wrote: > >> Pascal doesn't have things like step... > > > > hunh??? i don't think that's right but i'm just catching up after > > several 10+ hours days of $job... > > > > i know that i've written code in the past that did use something to > > step X numbers per run through the look and it did not involved > > manually incrementing the loop var... > > > > > I am not aware of any Pascal implementation that does have a STEP > parameter for FOR loops, and I am programming in Pascal at least as long > as you... ;-) > FPC documentation: https://www.freepascal.org/docs-html/ref/refsu58.html#x164-18600013.2.4 - at least FPC doesn't allow specifying an increment size. Several other languages do allow specifying an increment (nice list of for loop constructs with specified increment in various languages: https://www.rosettacode.org/wiki/Loops/For_with_a_specified_step). Modula-2 or Oberon-2 code snippets could perhaps be mistaken for Pascal through the mists of time. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compile fpc twice or only once during install?
On Fri, 12 Jul 2019, 14:19 Bo Berglund, wrote: > When I install FPC/Lazarus on new Linux systems I use a script I wrote > several years ago. It is cofigured for the actual versions to install > but otherwise it is self-contained. > > What it does concerning fpc is: > - Get the tagged version of the sources from svn (typically 3.0.4) > - Get the seed compiler 3.0.0, which I have stored on my website > - Build all using the seed compiler > - Install sources etc. > > Now I wonder if I should add a second "make all" after pointing to the > newly built 3.0.4 such that the final result is fpc 3.0.4 built from > sources compiled by itself? > > Or is this superfluous? > AFAIK the make file cycle through the compiler build process 3, starting a new cycle with the compiler from the previous cycle. So no need to make all a 2nd time, it is implicit in the make file recipe. > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compile for WinCE 7, target ARM, CPU Cortex-A9
On Thu, Apr 4, 2019 at 1:13 PM LacaK wrote: > Answering my own question: > > When I build cross compiler using FpcUpDeluxe, where I set "Cross Build > Options Override" to "-Cparmv7A" (The Cortex -A9 cores implement the > ARMv7-A architecture) then I can sucessfully compile my application for > WinCE 7. > > Drawback is that I must now maintain 2 FPC installations/cross-compilers > (Win32-WinCE): one for targer WinCE 5,6 with CPUs ARMv5 and another for > WinCE 7 with ARMv7 CPU (It is not sufficient to setup build modes in > project ... also all units must be pre-compiled ... at least I do not > know how to bypass this limitation) > > -Laco. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal I suspect your problem is related to this feature request: https://bugs.freepascal.org/view.php?id=30294 Note that you probably don't need two different cross compilers if your cpu-OS target is the same, only two different versions of the RTL (and perhaps packages) in a way that enables the compiler to pick the correct version. For avr-embedded I change the unit output folder name to avr-embedded-SUBARCH and add the subarch macro to fpc.cfg. For arm you may also need to handle different ABI versions (I don't cross compile for arm). ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Registers used by calling conventions
On Sat, Mar 9, 2019 at 12:13 AM Anthony Walter wrote: > ... The {$asmmode intel} compiler directive changes the asm syntax of > what's allowed in your unit, but it does not change how dissasembled code > is displayed in the Lazarus dissasembler view. I'd like to see instructions > dissambled in the Lazarus helper window using the Intel style. I wasn't > referring to the asm code in the source code editor. > The disassembly is prepared by the debugger. For GDB you can set the disassemble flavour by "set disassemble-flavor intel". In Lazarus: Tools - Options, go to Debugger - General then look for property AssemblerStyle and change to gdasIntel. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] INSTALL_PREFIX, INSTALL_LIBDIR
On Fri, 19 Oct 2018, 16:40 christo, wrote: > On 2018/10/18 09:26, Mattias Gaertner via fpc-pascal wrote: > > How to control where 'make install' puts the libraries (e.g. > > libpas2js.so)? > > > > I tried "INSTALL_LIBDIR=~/tmp/lib64", but that moves everything *except* > > libraries to "~/tmp/lib64". > > > > See bug https://bugs.freepascal.org/view.php?id=34346 > > In trunk (rev. 39838): > > "make info FPC=[path to ppcx64]" gives: > Hang on, the packages and utilities are installed with fpmake, so one also has to figure out how fpmake handles the - - prefix and - - baseinstalldir parameters... > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Will moving from due core CPU to 6 Core CPU of the same clock speed improve the speed of FPC compiling?
On Tue, Aug 7, 2018 at 9:42 AM, Dennis Poon wrote: > Only 20 seconds. But sometimes, when I modify some units used by other > units which are in turn used by other units, FPC throws the following > exception when I compile (not build) > uspdata.pas(228,50) Error: Compilation raised exception internally > > When that happens, I have to build the entire project, and that takes much > longer. > Are you perhaps using generics somewhere in your project? If so your compiler crash may be similar to bugs 0033593, 0034024 and possibly 0034065. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Is this the correct way to configure fpc for multiple arm-embedded subarchs?
On Wed, Jul 4, 2018 at 9:21 AM, Tomas Hajny wrote: > On Wed, July 4, 2018 07:53, Christo wrote: > > Any hints on how to compile and use fpcmake so that changes in the ini > > file ends up in the generated MakeFile? > > I assume that you updated fpcmake.ini in /fpcsrc/utils/fpcm/ (or without > /fpcsrc if using a checkout of the fpc repository rather than fpcbuild) > and rebuilt either all utils, or just fpcmake, right? Could you please > check whether fpcmake.inc (in the same directory) got updated during the > rebuild (this should reflect your changes to fpcmake.ini)? If I understand > it correctly, you copied the resulting updated fpcmake binary into the > respective RTL directory and tried to regenerate the Makefile there, > correct? My update procedure is basically what you describe: I manually added the changes from r30766 fpcmake.ini to trunk, then call make inside the fpcm directory, then execute the newly compiled fpcmake with the Makefile.fpc file in the fpcm directory as test. Tonight I will check if fpcmake.inc got updated. Thanks for this hint, I don't yet know how the different fpcmake pieces fit together. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Generating RTL Units for STM32 Processors
On 28 Feb 2018 4:22 am, "R0b0t1"wrote: I will be following up with you off list, since you do not seem to mind. I'm also interested in the general topic of incorporating embedded controllers (avr at the moment) into fpc. It would be useful to me if I could follow at least the general highlights for the porting process, not necessarily all the platform specific details. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Is this the correct way to configure fpc for multiple arm-embedded subarchs?
Michael, I have just noticed a target-subdir folder in svn.freepascal.org/svn/fpc/branches/target-subdir/ It seems as if rev 30766 contains Florian's first modifications to implementation the subarch subfolder option. On 4 Dec 2017 9:23 am, "Michael Ring"wrote: Hi Florian! I would like to work on this patch, can you share it with me? Thank you, Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Is there a way to execute code after 'initialization' and before 'main', i. e. AddExitProc complement?
On 28 Nov 2017 9:04 PM, "Роман via fpc-pascal" < fpc-pascal@lists.freepascal.org> wrote: > Can I run SortAndInitialize before 'main' without additional user actions? Maybe not exactly what you want but you could probably add the SortAndInitialize procedure to the initialization section of a new unit and add this unit as the last unit to your program. This use case is probably a good candidate for using the "section" modifier to specify initialization sequence. Unfortunately not available in the compiler for code sections AFAIK. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] compiler option for $J directive
>> They were used mainly back at TP times to have procedure local static variables (cause that is how they behave as inside procedures). > > Can we make the {$J-} as default in fpc and objfpc mode for the next major release? +1 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Serial communications: synaser vs FPC's serial unit
On Fri, Aug 18, 2017 at 9:39 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2017-08-18 07:51, Christo Crause wrote: > >> I've also just noted a typing error in GetSerialPortNames: '/dev/ttyAM*' >> should rather be '/dev/ttyACM*'' >> > > My version also has the first instance (ttyAM*) with a comment "ARM > boards". Your implementation in the bug report looks a lot better than what > I have in my synaser copy - cleaner code with less code duplication. Thanks > for the reply. Right, not a typo then. Good to learn something new - apparently ttyAMA* is the device name specified by the ARM AMBA style serial ports driver for Linux: ( https://code.woboq.org/linux/linux/drivers/tty/serial/amba-pl011.c.html#2514 ) So I looked for a systematic naming convention, but according to the Linux allocated devices list ( https://static.lwn.net/kerneldoc/admin-guide/devices.html) there is a large number of tty* names in use for different serial drivers. Perhaps a different approach (https://stackoverflow.com/a/9914339) is called for... ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Serial communications: synaser vs FPC's serial unit
I see the common Linux port names got added to Synaser (trunk) but the BDS variants (https://sourceforge.net/p/synalist/bugs/21/) wasn't added. I've also just noted a typing error in GetSerialPortNames: '/dev/ttyAM*' should rather be '/dev/ttyACM*'' On Thu, Aug 17, 2017 at 3:45 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > Now for the Synaser unit - the one I have is from 2013, and I already > noticed that there is no support for FreeBSD's /dev/* names to access > serial ports. Granted I added FreeBSD support to the GetSerialPortNames() > function in 5 minutes, but this doesn't bode to well then for the Synaser > unit - what else could be missing that I don't know of? > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC for AVR
On 04 Jun 2017 8:29 PM, "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk> wrote: > > What sort of targets are people looking at, what sort of debugging is available, and has anybody experimented with the "AVR Dragon"? As a hobbyist I've built some simple projects with arduino and then standalone mega and tiny range controllers using avr-gcc. Don't have hardware debugger. I have recently started avr programming on fpc-pascal. The trunk compiler is already quite good. One problem is obviously lack of libraries to interface with peripherals such as LCD, serial, SD cards etc. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Get value of PPChar ?
I suppose you have to allocate memory and create a pointer to a pointer to this memory which you pass to the function. On 16 Apr 2017 4:58 PM, "fredvs"wrote: > Hello. > > A C method is defined like this: > > MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); > > and translated in Pascal with this: > > function mpg123_icy(mh: Tmpg123_handle; var icy_meta: PPChar): integer; > cdecl; > > OK, the function seems to work because the result = 0 (no error). > > But how to retrieve the data icy_meta (PPChar) ? > > var > theicytag : PPChar; > resu : integer; > ... > > resu := mpg123_icy(ahandle, theicytag); > if resu = 0 then writeln(theicytag^); --> raise exception + crash > > resu := mpg123_icy(ahandle, theicytag); > if resu = 0 then writeln(theicytag^^); --> also raise exception + crash > > Fre;D > > > > > > - > Many thanks ;-) > -- > View this message in context: http://free-pascal-general. > 1045716.n5.nabble.com/Get-value-of-PPChar-tp5728277.html > Sent from the Free Pascal - General mailing list archive at Nabble.com. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] AVR Busy Wait implementation
There is a lot of useful information in avr-gcc code, once you can see past the peculiarities of C. See the implementation of avr-gcc's delay here: cvs.savannah.gnu.org/viewvc/avr-libc/include/util/delay.h and delay_basic.h in the same folder. Basically they use op codes with fixed cpu cycles to construct the inside of the loop and use compile time constants to calculate the number of iterations required for a delay. The focus of the code is to get accurate delays down to a few cpu cycles. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] EAccessViolation
On 13 Aug 2015 10:15 PM, Chris Moody inqu...@greensnakedesign.com wrote: Hi all, I have this procedure in my program: procedure DisplayNode (var node:astring); var c, i:integer; begin i:=SizeOf(node); if (i=0) then begin writeln ('node was empty / non existant'); exit; end; for c:=0 to i do writeln (node[c]);// line 85 end; astring is an Array of String The code compiles fine, however when I run it I get: An unhandled exception occurred at $00400B3A : EAccessViolation : Access violation $00400B3A line 85 of Dentist.pas $00400C8C line 95 of Dentist.pas Line 85 is the writeln above, line 95 is where I call this procedure from the main code. How do I track down what is going on? If your familiar with PHP, my purpose of this procedure is to basically emulate the following code: pre?php print_r (node); ?/pre Thanks in advance, Chris SizeOf(node) will return the size of the pointer to node. I suspect you want to loop over elements in an array so use length(node) to find out the number of elements in node. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Adding USB library to FPC
I have seen several header translations of the various libusb variants (0.1, 1.0 win32) scattered on the web and forums. I have also noticed several dead links, a typo or two and some missing function declaration in some of the available pascal translations. Would it not make sense to include a FPC package with a header translation for say the libusb 0.1 win32 libraries? I mention these two since they seem to be compatible at an API level, hence would be ideal for cross-platform support. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal