User avatar
RichardRussell
Posts: 1082
Joined: Thu Jun 21, 2012 10:48 am

Re: BBC BASIC on the Raspberry Pi Pico?

Wed Sep 15, 2021 10:00 pm

lurk101 wrote:
Wed Sep 15, 2021 8:44 pm
Since you have included the littlefs and fatfs source in your repo you should delete the .gitmodules file from the root directory. It is not needed.
Was that comment addressed to me? I've not (deliberately) made master any different from picostuff in that respect, my intention was to make the contents of mcu/ identical.

Can you advise on why I can't get compare to give meaningful results? I was hoping it would alert me to just such unintended differences between the branches.

ejolson
Posts: 8284
Joined: Tue Mar 18, 2014 11:47 am

Re: BBC BASIC on the Raspberry Pi Pico?

Wed Sep 15, 2021 10:25 pm

RichardRussell wrote:
Wed Sep 15, 2021 10:00 pm
lurk101 wrote:
Wed Sep 15, 2021 8:44 pm
Since you have included the littlefs and fatfs source in your repo you should delete the .gitmodules file from the root directory. It is not needed.
Was that comment addressed to me? I've not (deliberately) made master any different from picostuff in that respect, my intention was to make the contents of mcu/ identical.

Can you advise on why I can't get compare to give meaningful results? I was hoping it would alert me to just such unintended differences between the branches.
Another aspect of Git is the many eyes effect. We catch each others' errors.

If you look at picostuff the /mcu directory looks like
    picostuff.png
    picostuff.png (10.36 KiB) Viewed 1106 times
      Note that the directories for littlefs and fatfs are actually links to other repositories. This is different than master, where the contents of those separate repositories are directly merged into the source tree.

      There are advantages and disadvantages to either way, but as the tradeoffs are self-evident there isn't much point discussing them here. The main question is which do you want? After that the master needs to be made consistent with that decision.

      User avatar
      RichardRussell
      Posts: 1082
      Joined: Thu Jun 21, 2012 10:48 am

      Re: BBC BASIC on the Raspberry Pi Pico?

      Wed Sep 15, 2021 11:53 pm

      ejolson wrote:
      Wed Sep 15, 2021 10:25 pm
      The main question is which do you want?
      This is all getting too complicated for me, I can't get my head around it. If it's something I can fix myself, can you give me instructions? If it can only be fixed by a pull request, can you make one?

      Memotech Bill
      Posts: 329
      Joined: Sun Nov 18, 2018 9:23 am

      Re: BBC BASIC on the Raspberry Pi Pico?

      Thu Sep 16, 2021 12:19 am

      Memotech Bill wrote:
      Wed Sep 15, 2021 6:56 pm
      RichardRussell wrote:
      Wed Sep 15, 2021 5:26 pm
      It's my repository that I would like to be checked for correctness, not yours!
      Your repository builds using cmake. I have not tried the Makefile.
      Revise that. "cmake -DFAT=Y ..." is broken. There is a workaround in Makefile, but for me at least that is not convenient.

      To fix that I suggest undoing some of lurk101's work:

      Code: Select all

      cd mcu/fatfs
      git mv source/*.c .
      git mv source/*.h .
      git rm -f ffconf.h
      git rm -rf source
      
      Then edit console/pico/Makefile and delete the block:

      Code: Select all

      # GCC always searches the source file's directory first for quoted includes.
      # Unfortunately fatfs uses quoted include #include "ffconf.h"
      # This prevents us from overriding the default fatfs configuration
      # without modifying it as part of the fatfs submodule. We don't want to
      # do that. Instead this kludge. Create symbolic links elsewhare to those
      # fatfs source files we want to use. In the same folder we have our
      # customized ffconf.h file.
      
      ../../mcu/fatfs/ff.c:
      	ln -s ../../mcu/fatfs/source/ff.c ../../mcu/fatfs/ff.c
      
      ../../mcu/fatfs/ff.h:
      	ln -s ../../mcu/fatfs/source/ff.h ../../mcu/fatfs/ff.h
      
      ../../mcu/fatfs/ffsystem.c:
      	ln -s ../../mcu/fatfs/source/ffsystem.c ../../mcu/fatfs/ffsystem.c
      
      ../../mcu/fatfs/ffunicode.c:
      	ln -s ../../mcu/fatfs/source/ffunicode.c ../../mcu/fatfs/ffunicode.c
      
      ../../mcu/fatfs/diskio.h:
      	ln -s ../../mcu/fatfs/source/diskio.h ../../mcu/fatfs/diskio.h
      

      ejolson
      Posts: 8284
      Joined: Tue Mar 18, 2014 11:47 am

      Re: BBC BASIC on the Raspberry Pi Pico?

      Thu Sep 16, 2021 12:42 am

      Memotech Bill wrote:
      Thu Sep 16, 2021 12:19 am
      Memotech Bill wrote:
      Wed Sep 15, 2021 6:56 pm
      RichardRussell wrote:
      Wed Sep 15, 2021 5:26 pm
      It's my repository that I would like to be checked for correctness, not yours!
      Your repository builds using cmake. I have not tried the Makefile.
      Revise that. "cmake -DFAT=Y ..." is broken. There is a workaround in Makefile, but for me at least that is not convenient.

      To fix that I suggest undoing some of lurk101's work:

      Code: Select all

      cd mcu/fatfs
      git mv source/*.c .
      git mv source/*.h .
      git rm -f ffconf.h
      git rm -rf source
      
      Then edit console/pico/Makefile and delete the block:

      Code: Select all

      # GCC always searches the source file's directory first for quoted includes.
      # Unfortunately fatfs uses quoted include #include "ffconf.h"
      # This prevents us from overriding the default fatfs configuration
      # without modifying it as part of the fatfs submodule. We don't want to
      # do that. Instead this kludge. Create symbolic links elsewhare to those
      # fatfs source files we want to use. In the same folder we have our
      # customized ffconf.h file.
      
      ../../mcu/fatfs/ff.c:
      	ln -s ../../mcu/fatfs/source/ff.c ../../mcu/fatfs/ff.c
      
      ../../mcu/fatfs/ff.h:
      	ln -s ../../mcu/fatfs/source/ff.h ../../mcu/fatfs/ff.h
      
      ../../mcu/fatfs/ffsystem.c:
      	ln -s ../../mcu/fatfs/source/ffsystem.c ../../mcu/fatfs/ffsystem.c
      
      ../../mcu/fatfs/ffunicode.c:
      	ln -s ../../mcu/fatfs/source/ffunicode.c ../../mcu/fatfs/ffunicode.c
      
      ../../mcu/fatfs/diskio.h:
      	ln -s ../../mcu/fatfs/source/diskio.h ../../mcu/fatfs/diskio.h
      
      I agree with this. Relying on symbolic links is also likely to make it more difficult to build bbcbasic.uf2 using a Windows host.

      Does anyone want to test the current Pico build system to see what needs to be changed for development using Windows? I'd try it myself but am staying out of the student computer labs as much as possible on account of the epidemic.
      Last edited by ejolson on Thu Sep 16, 2021 12:54 am, edited 1 time in total.

      ejolson
      Posts: 8284
      Joined: Tue Mar 18, 2014 11:47 am

      Re: BBC BASIC on the Raspberry Pi Pico?

      Thu Sep 16, 2021 12:51 am

      RichardRussell wrote:
      Wed Sep 15, 2021 11:53 pm
      ejolson wrote:
      Wed Sep 15, 2021 10:25 pm
      The main question is which do you want?
      This is all getting too complicated for me, I can't get my head around it. If it's something I can fix myself, can you give me instructions? If it can only be fixed by a pull request, can you make one?
      You first have to flip a coin:
      • heads -- link to a 3rd-party repository as a Git submodule.
        • tails -- keep all the files in the master repository.
        Post here how the coin lands. After that, the instructions should be pretty simple to tidy things up either way.

        Memotech Bill
        Posts: 329
        Joined: Sun Nov 18, 2018 9:23 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 10:11 am

        RichardRussell wrote:
        Wed Sep 15, 2021 9:15 pm
        ejolson wrote:
        Wed Sep 15, 2021 8:15 pm
        I think mcu/pico should disappear.
        Even before the Pico version was proposed, a question had been asked about porting BBC BASIC to Microcontrollers. So there may well be other similar ports and mcu/ should be appropriate to those too, otherwise the name is misleading.

        I'm guessing that there must be some Pico-specific content, so that should go in a Pico-specific directory. If that's not mcu/pico/ it could be console/pico. Failing that there should at least be pico in the filename.

        Either way what's important is that we don't take a mis-step with the structure of the repository at this stage which might make it difficult to add a version for a different microcontroller in the future.

        Not being at all familiar with modern microcontrollers and their special requirements, I'm trusting you and Bill with this. 8-)
        I have attempted to achieve this:
        • I have put the FatFS source files back the way I originally had them.
        • I have moved the Pico specific SD Card low level access routines into mcu/pico
        • mcu/lfswrap.c is generic. To make this clearer I have renamed a number of routines / variables from pico... to fsw...
        • mcu/lfspico.c contains the pico flash access routines. However it is mostly generic, with just a few #ifdef PICO blocks. I therefore renamed it lfsmcu.c. Also renamed lfspico.h to lfsmcu.h.
        • I have also created a separate mcu/pico_vga folder for my VGA & USB keyboard code. Mainly because this includes a "tusb_config.h" file, which must not be visible when building USB console mode.
        Eric, please will you review and let me know if you have any comments. If you are happy I will attempt to create a pull request for Richard.

        One question: Why are the linker script files in console/pico? Would it not be more logical to have them with the remainder of the source files in mcu/pico?

        ejolson
        Posts: 8284
        Joined: Tue Mar 18, 2014 11:47 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 3:09 pm

        Memotech Bill wrote:
        Thu Sep 16, 2021 10:11 am
        RichardRussell wrote:
        Wed Sep 15, 2021 9:15 pm
        ejolson wrote:
        Wed Sep 15, 2021 8:15 pm
        I think mcu/pico should disappear.
        Even before the Pico version was proposed, a question had been asked about porting BBC BASIC to Microcontrollers. So there may well be other similar ports and mcu/ should be appropriate to those too, otherwise the name is misleading.

        I'm guessing that there must be some Pico-specific content, so that should go in a Pico-specific directory. If that's not mcu/pico/ it could be console/pico. Failing that there should at least be pico in the filename.

        Either way what's important is that we don't take a mis-step with the structure of the repository at this stage which might make it difficult to add a version for a different microcontroller in the future.

        Not being at all familiar with modern microcontrollers and their special requirements, I'm trusting you and Bill with this. 8-)
        I have attempted to achieve this:
        • I have put the FatFS source files back the way I originally had them.
        • I have moved the Pico specific SD Card low level access routines into mcu/pico
        • mcu/lfswrap.c is generic. To make this clearer I have renamed a number of routines / variables from pico... to fsw...
        • mcu/lfspico.c contains the pico flash access routines. However it is mostly generic, with just a few #ifdef PICO blocks. I therefore renamed it lfsmcu.c. Also renamed lfspico.h to lfsmcu.h.
        • I have also created a separate mcu/pico_vga folder for my VGA & USB keyboard code. Mainly because this includes a "tusb_config.h" file, which must not be visible when building USB console mode.
        Eric, please will you review and let me know if you have any comments. If you are happy I will attempt to create a pull request for Richard.

        One question: Why are the linker script files in console/pico? Would it not be more logical to have them with the remainder of the source files in mcu/pico?
        When I made the first reorganisation there was no /mcu/pico directory. That was later added as an include directory to work around a problem with the SDK. Such an include directory is not needed with the alternative workaround involving changes only to the CMakeLists.txt file.

        My original intention was all mcu related files should be in /mcu and the Pico ones have pico in their filenames. For example lfswrap.c was supposed to be general for any microcontroller and lfspico.c contain specific code for programming the built-in flash memory on a Pico.

        The load map is in console/pico under the assumption that it is build specific and console/picovga will need to use a different load map with a second stack for the second processor.

        Anyway, that's the logic behind the original reorganisation. As stated before, my preference is to delete the mcu/pico directory as it was only there to hold the include stub for the first workaround to the printf bug. I prefer having a flatter source tree when there are less than about 50 files. The reasons for this is personal preference based purely on personal productivity. As long as there aren't more subdirectories than source files--like some Java projects--it is not important.

        If Bill's changes were made to a post-merge fork from Richard's tree, a pull should be easy. If not, the pull is likely to create all sorts of weird conflicts. Again, Git is not diff but a system for handling metadata of who made what change.

        At any rate, I'm happy. Thanks for working on this!

        ejolson
        Posts: 8284
        Joined: Tue Mar 18, 2014 11:47 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 4:26 pm

        RichardRussell wrote:
        Wed Sep 15, 2021 4:42 pm
        ejolson wrote:
        Wed Sep 15, 2021 3:10 pm
        The only way to make sure any software works is to use it. In my opinion, newly written Basic code examples for testing the Pico are essential to this thread, the success of the port and on topic.
        Programs written specifically for test purposes, perhaps, but I think it's pushing it to argue that a program for finding double palindromes is "essential to the thread"! If you didn't see the code I posted, maybe start a new thread where it would be on-topic (it found the palindromes, in the range used for the MicroPython example, in 178 seconds on the Pico).
        Since there were objections to testing the Pico port by writing new code which finds palindromes in this thread, could you post your code in

        viewtopic.php?f=144&t=319577

        The originator of that thread
        lurk101 wrote:
        Tue Sep 14, 2021 6:01 am
        My interests are twofold. First it's always surprising how problems are tacked differently based on language, and second how interpreted languages compare speed wise.
        Therefore, there's no need to create yet another thread. Given the focus, the readers of that thread may also find it interesting that in this case the Basic code runs five times faster than MicroPython.

        My experience is that newly written code often uncovers bugs in compilers and interpreters that existing test suits don't. For this reason (and the fact that I'm still a BBC Basic beginner) I would like to make modifications of that program and run it on the Pico here.
        Last edited by ejolson on Thu Sep 16, 2021 5:07 pm, edited 1 time in total.

        Memotech Bill
        Posts: 329
        Joined: Sun Nov 18, 2018 9:23 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 4:48 pm

        I have now created the pull request.

        A number of the changes are just files deleted or moved. Is this comprehensible?

        Another approach to finding differences might be to create a new folder somewhere on a Linux machine (perhaps called Bill), then in that folder do something like the following::

        Code: Select all

        git clone https://github.com/Memotech-Bill/BBCSDL.git
        diff -r -w -x .git -x build BBCSDL/ ../Original/BBCSDL/ >diff.txt
        
        Where "../Original/BBCSDL" is wherever a copy of your code is.
        The diff options are:
        • -r - Recursive - Compare folders
        • -w - Ignore differences in whitespace
        • -x .git - Ignore git files
        • -x build - Ignore build folders

        ejolson
        Posts: 8284
        Joined: Tue Mar 18, 2014 11:47 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 5:09 pm

        Memotech Bill wrote:
        Thu Sep 16, 2021 4:48 pm
        I have now created the pull request.

        A number of the changes are just files deleted or moved. Is this comprehensible?

        Another approach to finding differences might be to create a new folder somewhere on a Linux machine (perhaps called Bill), then in that folder do something like the following::

        Code: Select all

        git clone https://github.com/Memotech-Bill/BBCSDL.git
        diff -r -w -x .git -x build BBCSDL/ ../Original/BBCSDL/ >diff.txt
        
        Where "../Original/BBCSDL" is wherever a copy of your code is.
        The diff options are:
        • -r - Recursive - Compare folders
        • -w - Ignore differences in whitespace
        • -x .git - Ignore git files
        • -x build - Ignore build folders
        If it pulls cleanly, I'd prefer to do that, as this seems like a workflow we'll want to iterate in the future.

        Memotech Bill
        Posts: 329
        Joined: Sun Nov 18, 2018 9:23 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 6:39 pm

        I believe that this is a summary of the differences:

        Code: Select all

        Files BBCSDL_RR/console/pico/CMakeLists.txt and BBCSDL_Merge/console/pico/CMakeLists.txt differ
        Files BBCSDL_RR/console/pico/Makefile and BBCSDL_Merge/console/pico/Makefile differ
        Files BBCSDL_RR/mcu/fatfs/ffsystem.c and BBCSDL_Merge/mcu/fatfs/ffsystem.c differ
        Files BBCSDL_RR/mcu/lfsutil/Makefile and BBCSDL_Merge/mcu/lfsutil/Makefile differ
        Files BBCSDL_RR/mcu/lfsutil/mklfsimage.c and BBCSDL_Merge/mcu/lfsutil/mklfsimage.c differ
        Files BBCSDL_RR/mcu/lfswrap.c and BBCSDL_Merge/mcu/lfswrap.c differ
        Files BBCSDL_RR/mcu/lfswrap.h and BBCSDL_Merge/mcu/lfswrap.h differ
        Files BBCSDL_RR/README.md and BBCSDL_Merge/README.md differ
        Files BBCSDL_RR/src/bbccos.c and BBCSDL_Merge/src/bbccos.c differ
        Files BBCSDL_RR/src/bbpico.c and BBCSDL_Merge/src/bbpico.c differ
        
        Only in BBCSDL_Merge/console/pico: examples
        Only in BBCSDL_Merge/console/pico: vga_pico.ld
        Only in BBCSDL_Merge/mcu: lfsmcu.c
        Only in BBCSDL_Merge/mcu: lfsmcu.h
        Only in BBCSDL_Merge/mcu/pico: ff_disk.c
        Only in BBCSDL_Merge/mcu/pico: sd_spi2.c
        Only in BBCSDL_Merge/mcu/pico: sd_spi.h
        Only in BBCSDL_Merge/mcu/pico: sd_spi.pio
        Only in BBCSDL_Merge/mcu/pico: sympico.c
        Only in BBCSDL_Merge/mcu/pico: sympico.i
        Only in BBCSDL_Merge/mcu/pico: sympico.sh
        Only in BBCSDL_Merge/mcu: pico_vga
        
        Only in BBCSDL_RR/console/pico: README.md
        Only in BBCSDL_RR: .gitmodules
        Only in BBCSDL_RR/mcu/fatfs: diskio.c
        Only in BBCSDL_RR/mcu/fatfs: documents
        Only in BBCSDL_RR/mcu: ff_disk.c
        Only in BBCSDL_RR/mcu: lfspico.c
        Only in BBCSDL_RR/mcu: lfspico.h
        Only in BBCSDL_RR/mcu/pico: printf.h
        Only in BBCSDL_RR/mcu: sd_spi2.c
        Only in BBCSDL_RR/mcu: sd_spi.h
        Only in BBCSDL_RR/mcu: sd_spi.pio
        Only in BBCSDL_RR/mcu: sympico.c
        Only in BBCSDL_RR/mcu: sympico.i
        Only in BBCSDL_RR/mcu: sympico.sh
        Only in BBCSDL_RR: Pico.md
        

        Memotech Bill
        Posts: 329
        Joined: Sun Nov 18, 2018 9:23 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 6:52 pm

        This time I think I have really created the pull request.

        I did not click enough times on my first attempt :oops:

        ejolson
        Posts: 8284
        Joined: Tue Mar 18, 2014 11:47 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Thu Sep 16, 2021 8:53 pm

        Memotech Bill wrote:
        Thu Sep 16, 2021 6:52 pm
        This time I think I have really created the pull request.

        I did not click enough times on my first attempt :oops:
        I have a question about the FatFS file organisation: Are both approaches compatible with linking to the upstream FatFS repository as a Git submodule?

        lurk101
        Posts: 972
        Joined: Mon Jan 27, 2020 2:35 pm
        Location: Cumming, GA (US)

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 1:25 am

        ejolson wrote:
        Thu Sep 16, 2021 8:53 pm
        Memotech Bill wrote:
        Thu Sep 16, 2021 6:52 pm
        This time I think I have really created the pull request.

        I did not click enough times on my first attempt :oops:
        I have a question about the FatFS file organization: Are both approaches compatible with linking to the upstream FatFS repository as a Git submodule?
        FatFS is problematic when used as a submodule. It creates all of its files in a subfolder fatfs/source. Regrettably, ff.h and others use #include "ffconf.h" using a quoted filename.That tells GCC to look in the invoking source file's directory first for includes. This means there's no way to customize ffconf.h without modifying the submodule's source code, and that leads to no end of down the road problems.

        What I ended up doing is modifying the makefile to create symbolic links in fats to only the required files from fatfs/source, and placing the modified ffconf.h in the fatfs folder where the symbolic links are created. The CMakeLists file then uses the fatfs folder instead of fatfs/source.

        Ugly hack. It's all there in Richard's picostuff branch, at least is was last I looked.

        ejolson
        Posts: 8284
        Joined: Tue Mar 18, 2014 11:47 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 2:00 am

        lurk101 wrote:
        Fri Sep 17, 2021 1:25 am
        ejolson wrote:
        Thu Sep 16, 2021 8:53 pm
        Memotech Bill wrote:
        Thu Sep 16, 2021 6:52 pm
        This time I think I have really created the pull request.

        I did not click enough times on my first attempt :oops:
        I have a question about the FatFS file organization: Are both approaches compatible with linking to the upstream FatFS repository as a Git submodule?
        FatFS is problematic when used as a submodule. It creates all of its files in a subfolder fatfs/source. Regrettably, ff.h and others use #include "ffconf.h" using a quoted filename.That tells GCC to look in the invoking source file's directory first for includes. This means there's no way to customize ffconf.h without modifying the submodule's source code, and that leads to no end of down the road problems.

        What I ended up doing is modifying the makefile to create symbolic links in fats to only the required files from fatfs/source, and placing the modified ffconf.h in the fatfs folder where the symbolic links are created. The CMakeLists file then uses the fatfs folder instead of fatfs/source.

        Ugly hack. It's all there in Richard's picostuff branch, at least is was last I looked.
        Richard hasn't weighed in on whether he wants to use the submodule approach or keep all the files in master.

        The difficulty with FatFS seems a strike against submodules.

        If we keep all the files in master, I think it would be useful to have a readme in /mcu explaining how to manually update the in-tree version of FatFS. I could start such a document with a description about doing the same for LittleFS.

        Before that, I wonder if the coin came up heads or tails.

        viewtopic.php?p=1914056#p1914056

        lurk101
        Posts: 972
        Joined: Mon Jan 27, 2020 2:35 pm
        Location: Cumming, GA (US)

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 5:03 am

        ejolson wrote:
        Fri Sep 17, 2021 2:00 am
        The difficulty with FatFS seems a strike against submodules.
        More a strike against FatFS. You might consider dropping FatFS altogether. It requires external hardware and ties up a PIO as I recall.

        ejolson
        Posts: 8284
        Joined: Tue Mar 18, 2014 11:47 am

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 5:41 am

        lurk101 wrote:
        Fri Sep 17, 2021 5:03 am
        ejolson wrote:
        Fri Sep 17, 2021 2:00 am
        The difficulty with FatFS seems a strike against submodules.
        More a strike against FatFS. You might consider dropping FatFS altogether. It requires external hardware and ties up a PIO as I recall.
        Would this link be of any help?

        https://bestofcpp.com/repo/carlk3-no-OS ... I-RPi-Pico

        It seems to describe setting up FatFS as a Git submodule for the Raspberry Pico.

        lurk101
        Posts: 972
        Joined: Mon Jan 27, 2020 2:35 pm
        Location: Cumming, GA (US)

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 7:48 am

        ejolson wrote:
        Fri Sep 17, 2021 5:41 am
        lurk101 wrote:
        Fri Sep 17, 2021 5:03 am
        ejolson wrote:
        Fri Sep 17, 2021 2:00 am
        The difficulty with FatFS seems a strike against submodules.
        More a strike against FatFS. You might consider dropping FatFS altogether. It requires external hardware and ties up a PIO as I recall.
        Would this link be of any help?

        https://bestofcpp.com/repo/carlk3-no-OS ... I-RPi-Pico

        It seems to describe setting up FatFS as a Git submodule for the Raspberry Pico.
        Look closer. That's not the same FatFS code you're using.

        cadcam
        Posts: 3
        Joined: Sun Jan 31, 2021 12:38 pm

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 12:13 pm

        Sorry just picked up this thread, sounds really interesting, harking back to the
        days of network BBC/CMS 6502 standalone microcontrollers.

        I am sorry I may have missed it, but is there a webpage associated with the
        project giving what is implemented already and what is planned. In particular, access to
        control like functionality, some standard old BBC Basic some to take account of new
        fuctionality e.g.

        ADCs
        I2C - Slave/Master
        Sleep modes
        Interrupts

        Also is there a plane to have a repository of users code?

        Keep up the great work!

        BW

        DarkElvenAngel
        Posts: 1912
        Joined: Tue Mar 20, 2018 9:53 pm

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 1:13 pm

        ejolson wrote:
        Fri Sep 17, 2021 5:41 am
        lurk101 wrote:
        Fri Sep 17, 2021 5:03 am
        ejolson wrote:
        Fri Sep 17, 2021 2:00 am
        The difficulty with FatFS seems a strike against submodules.
        More a strike against FatFS. You might consider dropping FatFS altogether. It requires external hardware and ties up a PIO as I recall.
        Would this link be of any help?

        https://bestofcpp.com/repo/carlk3-no-OS ... I-RPi-Pico

        It seems to describe setting up FatFS as a Git submodule for the Raspberry Pico.
        It depends on your target board that library isn't compatible with demo board. Plus it uses FatFs as well. The SD card uses the PIO not the FatFs code. Another thing I noticed with that library is it recently switched from C to C++ and the code base change a lot. Might be better to stick with something you can control and not pull in a sub module. Unless it's a fork you have control over.

        lurk101
        Posts: 972
        Joined: Mon Jan 27, 2020 2:35 pm
        Location: Cumming, GA (US)

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 2:09 pm

        RichardRussell wrote:
        Wed Sep 15, 2021 10:00 pm
        lurk101 wrote:
        Wed Sep 15, 2021 8:44 pm
        Since you have included the littlefs and fatfs source in your repo you should delete the .gitmodules file from the root directory. It is not needed.
        Was that comment addressed to me? I've not (deliberately) made master any different from picostuff in that respect, my intention was to make the contents of mcu/ identical.
        It was, I only commented because your current master has a .gitmodules files indicating that littlelfs and fatfs are submodules as well all all of the actual submodule files in the mcu folder. That's a recipe for disaster.

        If submodules are declared in .gimodules then their target forlders should be empty in the master copy so they can be populated from their source using the git submodule command. The idea is that you don't bulk up your repo with files from the submodules which already exist in other repos. I say 'you' referring to contributors in general.

        The littlefs github repo is structured to be used as a submodule. For reasons previously explained, the fatfs github repo you copied the mcu/fatfs files from is not.

        Based on my experience here, I'd delete the .gitmodules file, keep the borrowed files since there aren't that many, and keep it simple!
        Last edited by lurk101 on Fri Sep 17, 2021 2:50 pm, edited 5 times in total.

        lurk101
        Posts: 972
        Joined: Mon Jan 27, 2020 2:35 pm
        Location: Cumming, GA (US)

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 2:13 pm

        DarkElvenAngel wrote:
        Fri Sep 17, 2021 1:13 pm
        Might be better to stick with something you can control and not pull in a sub module. Unless it's a fork you have control over.
        Yes, for that very reason Github is poluted with duplicated cruft rapidly falling out of date. If a Github project you depend on is updated there's probably a good reason.

        lurk101
        Posts: 972
        Joined: Mon Jan 27, 2020 2:35 pm
        Location: Cumming, GA (US)

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 2:47 pm

        DarkElvenAngel wrote:
        Fri Sep 17, 2021 1:13 pm
        Another thing I noticed with that library is it recently switched from C to C++ and the code base change a lot.
        As far as I can tell, the fatfs code was copied from here. No C++ there, released April 17, 2021.

        hippy
        Posts: 10751
        Joined: Fri Sep 09, 2011 10:34 pm
        Location: UK

        Re: BBC BASIC on the Raspberry Pi Pico?

        Fri Sep 17, 2021 2:58 pm

        lurk101 wrote:
        Fri Sep 17, 2021 2:13 pm
        DarkElvenAngel wrote:
        Fri Sep 17, 2021 1:13 pm
        Might be better to stick with something you can control and not pull in a sub module. Unless it's a fork you have control over.
        Yes, for that very reason Github is poluted with duplicated cruft rapidly falling out of date. If a Github project you depend on is updated there's probably a good reason.
        Absolutely. It's a nightmare if a user does an update and ends up with something they can't build or no longer works because a third-party has pulled the rug from under everyone's feet.

        You may only discover that what you provide has broken once it has and then users will be expecting you to fix things immediately and quickly, especially if they depend on it working. I have had that a few times when Raspberry Pi OS has had unannounced updates which have broken software I have provided to others.

        Far better to provide end-users with files you know will work and take on the burden of updating files you use from third-parties to the latest if you ever need to or choose to.

        Return to “General”