Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
reading
Jul 27, 2013

Malcolm XML posted:

yeah

i gave up when quartus shat the bed 4 times in an hour

if the only thing intel does w/ altera is make good fpga tools it'll be amazing

I take it Intel bought Altera? When did that happen?

It sucks trying to run a demo program and being told that an "IP Core" has expired because I'm over the 30 day free trial of some aspects of the software (but not other aspects!), for this device which cost me real Earth dollars. What a lovely move to sell a demo board and then nickel-and-dime people all over the place to buy pieces of software to actually use it.

The main barrier I have right now is that I cannot get any of their provided demo code (in c) to compile on the device, so I can't get any software interface going to do things like read the ADC values. It's a feature that this board has an integrated hard processor, unlike the Mojo board, but it's not a useful feature if I am going to have to laboriously build up a huge compile chain since the thing doesn't have internet access and I have to load files onto the SD card on my desktop to transfer anything.

reading fucked around with this message at 00:20 on Dec 30, 2015

Adbot
ADBOT LOVES YOU

feedmegin
Jul 30, 2008

ante posted:

There's a Verilog thread that is very dead.

Yeah, FPGA toolchains suck. Like, a lot.

I'm kind of surprised noone's ever tried to reverse engineer the commercial ones and come up with something better, to be honest.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
People have done exactly that with some of Lattice's stuff. I haven't checked it out because who the hell uses Lattice FPGAs,


FPGAs have also only really been accessible for non-professionals for 3 or 4 years, too, so I'm sure some cool stuff will happen over the next 5 years in the open source community.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
http://www.clifford.at/icestorm/ for the Lattice Ice40's exists. http://opencores.org/projects also has a bunch of code (great for learning!). This is the only FPGA I've ever gotten to work, Lattice's software works alright if you read what there is of the manuals. It at least outlines what your workflow should be, step by step. The only other one I've ever dealt with was a Xilinx Spartan from about 9 years ago. They happened to have one where I was at, and we couldn't get it to do a drat thing considering none of us had FPGA experience. An open source FPGA would be a dream ...

I've been working on getting it to run a grid of LED's, something it seems to excel at, it's just that TI makes a specialized device for the same price. I imagine they (the Ice40's) are really for cases where you need some more I/O with a little glue in between, where cutting out those glue parts would save a lot of time, money, and space. It's still fun to tinker with/break little processors though ;)

reading
Jul 27, 2013
Another issue with this DE0-Nano-SoC board is that the .bat files they provide for use in Windows are supposed to load .sof and .jic files on to the FPGA, but the .bat files never work! I'm doing everything in Win7, the board is hooked up and set to the right mode, but when I run the .bat files it just tells me that it can't find the files it needs even though they are in the same folder. Everything is just like it was out-of-the-box and still almost nothing works. Really annoying. I mean how can it be that lovely? :-(

The Quartus software has this nice block diagram method of programming and I was able to get one demo working that they provided a step-by-step instruction for, but I can't find a block item for the ADC or PWM so if I want that stuff I have to code it directly in .v which is slower than wiring up a block diagram. Really wish the hard processor/FPGA interaction worked. I would love for this thing to be my new beaglebone black.

elite_garbage_man
Apr 3, 2010
I THINK THAT "PRIMA DONNA" IS "PRE-MADONNA". I MAY BE ILLITERATE.
You can probably find generic code for those parts online. Import the code to your project, then just convert them to block diagram parts and wire away. There is also part wizard for some more complex parts so you may have to fire that up to get what you're looking for since the standard part list is limited to pretty basic stuff.

Also, if you just want to use the Nios 2/ARM, use Altera Monitor (you may have to download this separately but it's free). There should be a section in the board documentation for what IO addresses your board uses when the cpu core is loaded so you can start blinking leds using RISC assembly or C. You set the board you're using, the programmer type, then give it a source file for the asm/c code then hit program. Pretty easy compared to Quartus. They also have documentation on the Nios 2 ISA, and a separate one for ARM that you should definitely have handy.

As for the board demos, the Terasic tool I got with my board is all GUI based and loads the demos fine. Maybe try downloading the latest version for your board off the website if you haven't, or try contacting Terasic to see what they recommend. I wouldn't be surprised if it was a windows compatibility issue, or having to run them as admin.

elite_garbage_man fucked around with this message at 08:56 on Jan 1, 2016

Jo
Jan 24, 2005

:allears:
Soiled Meat
I'd like to attach a bunch of accelerometers to a device that supports I2C. It looks like the three that I bought all have the same address. Is it possible to reassign addresses, or am I stuck having to do some line fuckery? I was hoping I'd be able to just attach a whole bunch of devices on the bus, enumerate them somehow, and read off data from each. The headers and source file of this device seem to hint that it's expecting a fixed address. Is this commonplace for accelerometers? Or I2C devices in general?

Hyvok
Mar 30, 2010

Jo posted:

I'd like to attach a bunch of accelerometers to a device that supports I2C. It looks like the three that I bought all have the same address. Is it possible to reassign addresses, or am I stuck having to do some line fuckery? I was hoping I'd be able to just attach a whole bunch of devices on the bus, enumerate them somehow, and read off data from each. The headers and source file of this device seem to hint that it's expecting a fixed address. Is this commonplace for accelerometers? Or I2C devices in general?

I2C devices usually have an address you can configure to a few different options (like 2 or 4 or 8 different addresses are common). Usually done with external pins you need to set to set the address. They also can have one fixed address which is not uncommon either.

If you want to attach multiple devices to a microcontroller with the same I2C address you need something like a I2C bus multiplexer such as PCA8574: http://www.nxp.com/documents/data_sheet/PCA8574_PCA8574A.pdf Through which you can address multiple separate I2C buses.

Captain Cool
Oct 23, 2004

This is a song about messin' with people who've been messin' with you
If the address isn't fixed, there should be some address pins that allow you to set the bottom few bits of the address. If you don't have that then you're looking at using chip select/enable pins.

Jo
Jan 24, 2005

:allears:
Soiled Meat
Thanks, goons. I don't see any external pins for address select, so I'll look into chip select.

Aurium
Oct 10, 2010

Jo posted:

Thanks, goons. I don't see any external pins for address select, so I'll look into chip select.

What chip are you using?

BattleMaster
Aug 14, 2000

That's unfortunate; many I2C devices I've seen have at least two pins for configuring the same number of bits (usually the LSBs) of the address.

Edit: It's not an optimal solution, I'm sure, but consider using the hardware bus master for one of the ICs and bit-banging the others with GPIO pins and a software library.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
Probably going a bit into the newbie side here, but I plan on setting up my Beaglebone Black as a Plex media server (direct stream, transcoding disabled) to take over functionality from my desktop machine.

Has anyone here done something similar with a BBB? Is there a preferred OS? An OS that supports Limelight game streaming would be heavily preferred, but less important.

Jo
Jan 24, 2005

:allears:
Soiled Meat

Aurium posted:

What chip are you using?

Xadow COM01400P.

JawnV6
Jul 4, 2004

So hot ...
Huh, that's a neat little package.

The chip at the heart of it is: http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf

That has 1 address bit "ALT_ADDRESS", with page 18 describing the functionality:

quote:

I2C
With CS tied high to VDD I/O, the ADXL345 is in I2C mode, requiring a simple 2-wire connection, as shown in Figure 40. The ADXL345 conforms to the UM10204 I2C-Bus Specification and User Manual, Rev. 03—19 June 2007, available from NXP Semiconductors. It supports standard (100 kHz) and fast (400 kHz) data transfer modes if the bus parameters given in Table 11
and Table 12 are met. Single- or multiple-byte reads/writes are supported, as shown in Figure 41. With the ALT ADDRESS pin high, the 7-bit I2C address for the device is 0x1D, followed by the R/W bit. This translates to 0x3A for a write and 0x3B for a read. An alternate I2C address of 0x53 (followed by the R/W bit) can be chosen by grounding the ALT ADDRESS pin (Pin 12). This translates to 0xA6 for a write and 0xA7 for a read.
That module is using address 0x53, so ALT_ADDRESS is being tied to ground. You could potentially tie that to VCC instead and have those 2 modules on the same bus.

Aurium
Oct 10, 2010

Jo posted:

Xadow COM01400P.

Ok, that board uses the ADXL345. Since it's it's using the address 0x53, that means they've grounded the alt address pin (pin 12 in this case), if you raise it high, you can get the address 0X1D. Info found on page 18 of the datasheet.


Unfortunately, the board you're on has that pin directly connected to the ground fill of the board by a couple of relatively small traces. You could potentially cut them and then solder a wire to the pad and raise it high that way. Unfortunately, one of the traces you need to cut is directly underneath the accelerometer itself. So you'd need to desolder the chip, cut the traces, resolder the chip, and then add a wire to a pretty small pad.

Difficult. I wouldn't do it unless I had no choice. It'd be easier to build my own board.

Instead, you're probably going to have to bitbang i2c, hope whatever uC you're using has multiple i2c channels, or use a i2c bus multiplexer. I'd recommend the last http://hackaday.com/2015/08/12/i2c-bus-splitting-with-a-more-professional-touch/

JawnV6
Jul 4, 2004

So hot ...

Aurium posted:

Unfortunately, the board you're on has that pin directly connected to the ground fill of the board by a couple of relatively small traces.

I very nearly added "and wait till Aurium strolls through after peeking at the layout to explain why it's impossible"

Popete
Oct 6, 2009

This will make sure you don't suggest to the KDz
That he should grow greens instead of crushing on MCs

Grimey Drawer
Couldn't you just control the /CS line to enable the device to be in I2C mode and that is enough? You could then hook up as many devices as you want and set the correct GPIO to drive the /CS when you want to read/write I2C.

BattleMaster
Aug 14, 2000

Popete posted:

Couldn't you just control the /CS line to enable the device to be in I2C mode and that is enough? You could then hook up as many devices as you want and set the correct GPIO to drive the /CS when you want to read/write I2C.

The idea of an I2C device with a chip select boggles my mind; guys, just use SPI if you're going to do that :argh:

evensevenone
May 12, 2001
Glass is a solid.

feedmegin posted:

I'm kind of surprised noone's ever tried to reverse engineer the commercial ones and come up with something better, to be honest.
My understanding is that the problem is that even though they present themselves as just a bunch of identical logic elements, for performance reasons vendors have started adding special purpose hardware inside the fabric for commonly used stuff but all of that is hidden under the hood and they don't tell you any details, just that it will behave the same.

Jo
Jan 24, 2005

:allears:
Soiled Meat

Aurium posted:

Ok, that board uses the ADXL345. Since it's it's using the address 0x53, that means they've grounded the alt address pin (pin 12 in this case), if you raise it high, you can get the address 0X1D. Info found on page 18 of the datasheet.


Unfortunately, the board you're on has that pin directly connected to the ground fill of the board by a couple of relatively small traces. You could potentially cut them and then solder a wire to the pad and raise it high that way. Unfortunately, one of the traces you need to cut is directly underneath the accelerometer itself. So you'd need to desolder the chip, cut the traces, resolder the chip, and then add a wire to a pretty small pad.

Difficult. I wouldn't do it unless I had no choice. It'd be easier to build my own board.

Instead, you're probably going to have to bitbang i2c, hope whatever uC you're using has multiple i2c channels, or use a i2c bus multiplexer. I'd recommend the last http://hackaday.com/2015/08/12/i2c-bus-splitting-with-a-more-professional-touch/

Thanks so much! The last link looks like a perfect solution. Will report back if anything interesting happens.

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme
I'm new at embedded stuff above bare-metal, so be gentle.

I'm working with a MIPS24KEc-based SoC (MT7688) that has 3 16550A-compatible UARTs. It's running OpenWRT based on the 3.18 kernel.

Two of the UARTs are used for communicating with peripherals using a binary protocol at 34800 baud. They're located at /dev/ttyS1 and /dev/ttyS2 (ttyS0 is for console access) and I didn't really have anything to do with setting this up, but I can modify the device tree if needed.

Under difficult to replicate conditions, but presumably when the system is loaded, the two UARTs connected to peripherals occasionally overflow their receive FIFOs and drop bytes. This occurs dozens of times an hour. I've detected this by putting a brief printk in 8250_core.c where the OD bit is detected and seeing it in the console log.

I know that printing from an interrupt is usually a bad idea and I assume that my printk is making things worse than they actually are by slowing down the isr handler, but I don't know how else to get debug information out of the interrupt... I've also verified that the link is good and the sender is working ok by tapping the line with a faster computer and sniffing the data coming across.

TL;DR I think that the issue is caused by the kernel not emptying the receive FIFO quickly enough, but I don't know how to speed that up.

One thought is that the interrupt priorities are too low, they're set as 29 and 30 according to /proc/interrupts. Is this adjustable?

The interrupt is set to trigger when there are 8 bytes in the FIFO, this is a hard-coded configuration in 8250_core.c... I could change it if I need to, but it feels wrong.

Ponderous Saxon
Jan 5, 2010
Fallen Rib

evensevenone posted:

My understanding is that the problem is that even though they present themselves as just a bunch of identical logic elements, for performance reasons vendors have started adding special purpose hardware inside the fabric for commonly used stuff but all of that is hidden under the hood and they don't tell you any details, just that it will behave the same.

Around the mid 90's one company did reverse engineer the Xilinx configuration bitstream for use in their third-party EDA suite. Xilinx bought them out.

Focusing on the Xilinx ecosystem, creating a complete open-source replacement to Vivado/ISE today would constitute an unimaginable amount of effort. Certainly there are bits which you can and do replace (the IDE, netlist generator, simulator, etc.) but I can't see anyone replacing the core technology mapping and place-and-route because modern FPGAs are so drat huge and complex. They're not just glue-logic sea-of-gates with interconnect anymore, rather heterogeneous devices which include block RAM, DSP blocks, PLLs, SERDES, and whatever else can be shoehorned onto the die. None of this is particularly obfuscated (you need to know a lot about the device in order to efficiently target it and do manual floor-planning), the problem is how a third-party would do a place-and-route such that the timing and power analysis is correct.

Aurium
Oct 10, 2010

BattleMaster posted:

The idea of an I2C device with a chip select boggles my mind; guys, just use SPI if you're going to do that :argh:

It's actually quite a clever device. When /CS is high it's an i2c device, when it's low it's a SPI device.

You're also not going to be able to do any /CS fuckery on this board either to have only one of them respond to I2C commands at a time either. Once again it's tied to high with a trace that goes underneath the chip.


Jo posted:

Thanks so much! The last link looks like a perfect solution. Will report back if anything interesting happens.

Good choice, after I posted my last message I came to the conclusion that the other 2 options would be nearly impossible on that hardware without things like hacked up flatflex cables, or your own custom boards (with flatflex cable hookups), or really fine hardware mods. With the bus multiplexer you'd just need one board that already breaks out the SDA/SCL lines, which it looks like all the boards do, as well as a carrier board for the multiplexer itself (ok, you could deadbug it...). Note that whatever the board is that you're using to breakout the SDA/SCL lines has to be something other than the accelerometer board. The multiplexer needs to be in front of all of the devices with the same address. After the multiplexer though, you'd just solder to the SDA/SCL breakouts on the accelerometer boards.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

Knyteguy posted:

Probably going a bit into the newbie side here, but I plan on setting up my Beaglebone Black as a Plex media server (direct stream, transcoding disabled) to take over functionality from my desktop machine.

Has anyone here done something similar with a BBB? Is there a preferred OS? An OS that supports Limelight game streaming would be heavily preferred, but less important.

Just for future reference in case someone wants to tackle this -

With a Beaglebone Black Rev A6 board (so a very old one), I setup Ubuntu 14 on it flashed from an SD card. I feel like this was the most difficult part. I tried Debian/Angstrom first, but I couldn't find a lot of useful troubleshooting guides. After the OS installed I followed this guide (I think, it may have been the Banana Pi one) to get Plex Media Server installed:

http://www.htpcguides.com/install-plex-media-server-on-raspberry-pi-2/

Starting from:
pre:
wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
I have an external HDD so I had it auto mount by adding an fstab line.

Finally I setup this script
code:
#!/bin/bash

login=FTP_LOGIN
pass=FTP_PASS
host=FTP_HOST
remote_dir=FULL_REMOTE_PATH
local_dir=FULL_LOCAL_PATH


trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM

if [ -e /tmp/synctorrent.lock ]
then
  echo "Synctorrent is running already."
  exit 1
else

  touch /tmp/synctorrent.lock

  lftp -u $login,$pass $host << EOF
  set ftp:ssl-allow no
  set mirror:use-pget-n 5
  mirror -c -P5 --log=synctorrents.log $remote_dir $local_dir
  quit
EOF

  rm -f /tmp/synctorrent.lock
  exit 0
in cron to sync with my server box. I didn't write this script.

I'm powering the board and external HDD with a powered USB hub, and voila it's a nice little NAS/DLNA server. I'll probably get NFS on there soon also. The media server/non DLNA Plex will work where there's no transcoding required. A more powerful board could transcode.

If you wanted to get a micro HDMI/adapter you could likely get Moonlight game streaming working (along with this Steam Emulation manager I wrote!), but I decided it wasn't worth the effort at the moment.

Knyteguy fucked around with this message at 18:41 on Jan 11, 2016

JawnV6
Jul 4, 2004

So hot ...

meatpotato posted:

I know that printing from an interrupt is usually a bad idea and I assume that my printk is making things worse than they actually are by slowing down the isr handler, but I don't know how else to get debug information out of the interrupt... I've also verified that the link is good and the sender is working ok by tapping the line with a faster computer and sniffing the data coming across.
Yeah printf in a ISR is generally a bad idea. ISR's should be short and direct, very little flow control and certainly nothing like unbounded polling.

The typical way to break things up is to have something in the ISR do a very lightweight memory operation (i.e. copy FIFO length & OD bit out) then have application code come along later and process it. So in your ISR, have it write whatever information you need (hopefully measured in bytes) into some shared structure and another process poll there to take the results and print them out for you. If it's possible to have several ISR's fire before application code could empty the results out, either set the results area up as a ring buffer or just mark that you're deleting old data.

Specific to your problem, on the system level switching to a speed faster than 38400 or using hardware flow control on the UART could help. Making the buffer deeper might make the condition more rare, but probably won't solve it entirely and if the length is hard-coded your concern that something else might not work properly may be correct.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I've been learning Verilog over the past few months and a somewhat trivial question has been bugging me. Is there a reason to do declarations like this in Verilog:
code:
module rom(clk, addr, dout);
    input clk;
    input [7:0] addr;
    output [7:0] dout;
    reg [7:0] mem [255:0];

    initial begin
        $readmemh("file.hex", mem);
    end

    always @(posedge clk)
        dout <= mem[addr];
endmodule
... over this?
code:
module rom(
    input wire clk,
    input wire [7:0] addr,
    output reg [7:0] dout);

    reg [7:0] mem [255:0];

    initial begin
        $readmemh("file.hex", mem);
    end

    always @(posedge clk)
        dout <= mem[addr];
endmodule
I prefer the latter for no real reason, maybe because it seems easy to see who's driving who, and what resources get taken up? I think the majority of code I see uses the former, sometimes with variable white-spacing. Is there any sort of common white-spacing style in use? Heck, sometimes I see declarations in the order of whatever the author bothered to type first. I'd like to think that I understand digital logic well, so most of the 'gotchas' of the hardware description aspect I can grasp pretty quickly, it's just that I'd like other people to be able to read it without a lot of trouble.

carticket
Jun 28, 2005

white and gold.

Here's a reason:
code:

module using_defparam
#(
    param input_max = 4096,
    defparam input_width = $clog2(input_max)
)
(
    input [input_width-1:0] in_data
);
Isn't valid. You can't use a defparam in a parameter block, so if you want to calculate widths from maximums without putting $clog2's in all your definitions, you need to use the first style you have where you can declare your params and defparams before your interface types/sizes.

What I would prefer is to define input/output in the module declaration, and then size (if variable) below, but that causes ModelSim to barf (seems to want all or nothing in the declaration). I'm sure an experienced Verilog user would shudder at the way I do it, but it works for me.

Edit: wrote that on a phone and butchered it.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Mr. Powers posted:

Here's a reason: You can't use a defparam in a parameter block, so if you want to calculate widths from maximums without putting $clog2's in all your definitions, you need to use the first style you have where you can declare your params and defparams before your interface types/sizes.

What I would prefer is to define input/output in the module declaration, and then size (if variable) below, but that causes ModelSim to barf (seems to want all or nothing in the declaration). I'm sure an experienced Verilog user would shudder at the way I do it, but it works for me.

Edit: wrote that on a phone and butchered it.

Makes sense, and explains why the manufacturer's ram example does it like that. I haven't messed with params much, just trying to make stuff work in eight bits and then I figured I'd shove 'em in once I got some good modules. Guess I'm gonna have to fix the old ones ...

I've been using Icarus Verilog and it'll eat anything apparently ...

I feel like it is inevitable that everything I write in Verilog would make at least one other Verilog user puke if they were to see it.

dougdrums fucked around with this message at 02:38 on Jan 12, 2016

JawnV6
Jul 4, 2004

So hot ...
code:
m(.*)
:getin:

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme

JawnV6 posted:

Yeah printf in a ISR is generally a bad idea. ISR's should be short and direct, very little flow control and certainly nothing like unbounded polling.

The typical way to break things up is to have something in the ISR do a very lightweight memory operation (i.e. copy FIFO length & OD bit out) then have application code come along later and process it. So in your ISR, have it write whatever information you need (hopefully measured in bytes) into some shared structure and another process poll there to take the results and print them out for you. If it's possible to have several ISR's fire before application code could empty the results out, either set the results area up as a ring buffer or just mark that you're deleting old data.

Specific to your problem, on the system level switching to a speed faster than 38400 or using hardware flow control on the UART could help. Making the buffer deeper might make the condition more rare, but probably won't solve it entirely and if the length is hard-coded your concern that something else might not work properly may be correct.

I still haven't figured out why the system isn't servicing the ISR quickly enough, but I've discovered debugfs and think it may be a less-idiotic way of getting the stats I need into userspace than printks in an isr. Can you tell I'm a Linux noob?

It also turned out that lowering the 16550 FIFO interrupt trigger level from 8 to 4 bytes didn't significantly fix the issue after running a longer test. The improvement was only ~10%, so something more serious is going on but I'm not sure what it is.

I'll keep poking around and post if I fix it, thanks for taking the time to think about it.

EDIT: Whoops, looks like debugfs isn't what I want at all! I thought it was kind of like /proc files.

Hunter2 Thompson fucked around with this message at 00:58 on Jan 13, 2016

Aurium
Oct 10, 2010

Ponderous Saxon posted:

Around the mid 90's one company did reverse engineer the Xilinx configuration bitstream for use in their third-party EDA suite. Xilinx bought them out.

Focusing on the Xilinx ecosystem, creating a complete open-source replacement to Vivado/ISE today would constitute an unimaginable amount of effort. Certainly there are bits which you can and do replace (the IDE, netlist generator, simulator, etc.) but I can't see anyone replacing the core technology mapping and place-and-route because modern FPGAs are so drat huge and complex. They're not just glue-logic sea-of-gates with interconnect anymore, rather heterogeneous devices which include block RAM, DSP blocks, PLLs, SERDES, and whatever else can be shoehorned onto the die. None of this is particularly obfuscated (you need to know a lot about the device in order to efficiently target it and do manual floor-planning), the problem is how a third-party would do a place-and-route such that the timing and power analysis is correct.

There's been some recent work to get an opensource setup for the Lattice iCE40. Not being a FPGA guy, I don't really know how finished it is, but it claims to be "feature complete (with the exception of timing analysis, which is work in progress)." Which you already noted as one of the major potential stumbling blocks.

https://media.ccc.de/v/32c3-7139-a_free_and_open_source_verilog-to-bitstream_flow_for_ice40_fpgas#video

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Aurium posted:

There's been some recent work to get an opensource setup for the Lattice iCE40. Not being a FPGA guy, I don't really know how finished it is, but it claims to be "feature complete (with the exception of timing analysis, which is work in progress)." Which you already noted as one of the major potential stumbling blocks.

https://media.ccc.de/v/32c3-7139-a_free_and_open_source_verilog-to-bitstream_flow_for_ice40_fpgas#video

This is what I've been using, everything has worked as expected. I think the PLL isn't supported, but I haven't tried to use it yet. Lattice's tools work fine too (and come with the dev board), but make is easier to use and I don't want to use a VM. The iCE40 line is all pretty tiny too, I'm thinking that may help.

reading
Jul 27, 2013

elite_garbage_man posted:

You can probably find generic code for those parts online. Import the code to your project, then just convert them to block diagram parts and wire away. There is also part wizard for some more complex parts so you may have to fire that up to get what you're looking for since the standard part list is limited to pretty basic stuff.

Also, if you just want to use the Nios 2/ARM, use Altera Monitor (you may have to download this separately but it's free). There should be a section in the board documentation for what IO addresses your board uses when the cpu core is loaded so you can start blinking leds using RISC assembly or C. You set the board you're using, the programmer type, then give it a source file for the asm/c code then hit program. Pretty easy compared to Quartus. They also have documentation on the Nios 2 ISA, and a separate one for ARM that you should definitely have handy.

As for the board demos, the Terasic tool I got with my board is all GUI based and loads the demos fine. Maybe try downloading the latest version for your board off the website if you haven't, or try contacting Terasic to see what they recommend. I wouldn't be surprised if it was a windows compatibility issue, or having to run them as admin.

Thank you for the info. I'm still working with this thing. Currently I can't run that DE0_Nano_ControlPanel.exe because it can't find the jtag .dll (same problem as this guy http://www.alteraforum.com/forum/showthread.php?t=45942 . I'm also in Win 8.1, 64 bit).

I have recompiled several of the demonstrations using this chip (since they naturally come compiled with a different chip as their target! What the heck!) and loaded them on the board without any complaints from Quartus or the Programmer. However all they do is keep all the LEDs very dimly lit, so, there must be some error in the logic or pin assignments that I need to find and fix. This is the Gsensor demo and the PWM LED demo.

carticket
Jun 28, 2005

white and gold.

There's a third party packaging Windows 8.X/10 drivers for the programmer. I'll find the link...

http://altera-guide.blogspot.com/2012/11/many-collage-students-find-ourselves.html?m=1

I did this method on 10 64 and it worked. I was skeptical of the Dropbox link, so I grabbed the files from FTDI directly.

csammis
Aug 26, 2003

Mental Institution
Does anyone work with TI's MSP430 line and their open source GCC toolchain?

I'm picking up a project that I haven't touched in three years which was originally built with MSPGCC. I decided to download the new TI toolchain and give it a spin but it's giving me some linker problems which seem to be related to generated code size.

Using the MSPGCC toolchain and -g -Os I get the following from size:
code:
   text	   data	    bss	    dec	    hex	filename
    562	     54	      5	    621	    26d	main.elf
Using the TI toolchain, same compiler flags, no code changes, it won't even link:
code:
~/ti/gcc/bin/../lib/gcc/msp430-elf/5.2.1/../../../../msp430-elf/bin/ld: main.elf section `.text' will not fit in region `ROM'
~/ti/gcc/bin/../lib/gcc/msp430-elf/5.2.1/../../../../msp430-elf/bin/ld: main.elf section `.data' will not fit in region `RAM'
~/ti/gcc/bin/../lib/gcc/msp430-elf/5.2.1/../../../../msp430-elf/bin/ld:
  section __interrupt_vector_3 loaded at [000000000000ffe4,000000000000ffe5] overlaps section .text loaded at [000000000000f984,0000000000010515]
~/ti/gcc/bin/../lib/gcc/msp430-elf/5.2.1/../../../../msp430-elf/bin/ld: region `RAM' overflowed by 80 bytes
~/ti/gcc/bin/../lib/gcc/msp430-elf/5.2.1/../../../../msp430-elf/bin/ld: region `ROM' overflowed by 1516 bytes
collect2: error: ld returned 1 exit status
make: *** [main.elf] Error 1
What the hell? mspgcc is based on GCC 4.5.3 and the version of the TI toolchain I downloaded is based on GCC 5.2.1...I would have hoped the code generation would get better, not shittier. The MCU in question is a MSP430G2231 if that makes a difference.

JawnV6
Jul 4, 2004

So hot ...
Did the linker script change at all? Or is it pulling some generic description instead of something specific to the G2231?

csammis
Aug 26, 2003

Mental Institution

JawnV6 posted:

Did the linker script change at all? Or is it pulling some generic description instead of something specific to the G2231?

I'm not sure about MSPGCC. As far as I can tell the only hint that it has that it's looking at a G2231 is the -mmcu=msp430g2231 option. If it's using something specific that seems to be opaque to my Makefile at least.

The TI toolchain was being specifically passed ( via -T) some msp430g2231.ld script that was distributed with the toolchain. Sorry, I forgot to mention that in my first post :) The link result is the same whether I pass or don't pass the linker script argument.


edit: my grammar is bad today

csammis fucked around with this message at 00:19 on Jan 20, 2016

JawnV6
Jul 4, 2004

So hot ...
There should be a header file like msp430g2231.h, make sure it's not grabbing something generic like msp430g2xx1.h. But that's just for SFR's and other chip-specific things, missing that would not cause your current problem and if you're failing linking you're beyond anything in that header.

The .ld script is where errors like that come from. All my work was with CCS, so I'm sorta guessing at the mspgcc setup, but is the failing build producing a .map file anywhere? I can't suss out which numbers are wrong, you have 128b/0x80 of actual RAM, in no base is '54' too large to be contained in that by 80. The map file should tell you what's getting put where.

Adbot
ADBOT LOVES YOU

csammis
Aug 26, 2003

Mental Institution

JawnV6 posted:

There should be a header file like msp430g2231.h, make sure it's not grabbing something generic like msp430g2xx1.h. But that's just for SFR's and other chip-specific things, missing that would not cause your current problem and if you're failing linking you're beyond anything in that header.

I was using <msp430.h> but I tried changing it to <msp430g2231.h> just to make sure it wasn't including anything squirrelly. It didn't result in any change to the linker output.

quote:

.ld script is where errors like that come from. All my work was with CCS, so I'm sorta guessing at the mspgcc setup, but is the failing build producing a .map file anywhere? I can't suss out which numbers are wrong, you have 128b/0x80 of actual RAM, in no base is '54' too large to be contained in that by 80. The map file should tell you what's getting put where.

Yeah, I've got maps from both. gist for MSPGCC, gist for TI's msp430-gcc. I've never looked at linker output in this detail but taking a stab at this...

TI's linker is bringing in many more symbols. There's a metric ton of crap in the TI generated .text segment that isn't brought in by mspgcc...looks like TI is bringing in all of libc even though it's not explicitly referenced in code. Okay swell. Adding -nostdlib yields a different linker error:

code:
main.o: In function `hard_delay':
/Users/csammis/Projects/Hardware/MSP430/msp430-zeldachest/src/main.c:20: undefined reference to `__mspabi_divli'
The function in question:
code:
void hard_delay()
{
    __asm__
    (
        "mov #1000, r2  \n\t"
        "dec r2         \n\t"
        "jnz $-2        \n\t"
    );
}
Is the __asm__ builtin referencing symbols in stdlib? How does that happen?

  • Locked thread