I also am developing a project using ATmega32M1 with CAN bus. I'm considering making a full Arduino format board (I guess open source and the works). I see the pin mapping problem is quite a challenge.
RaMansell, when bringing up a new board, these new processors are much more forgiving than in the older days. (I suspect I was bringing up microprocessor boards before many visitors here were even born.) Quite a number of I/O and other important pins had to be working correctly for a micro-controller to boot properly.
In these new class processors with internal clocks, it is possible to start a level of debugging with only the reset and program loading pins working. But an oscilloscope is essential -- when you mention I/O happening or not, I don't see if you were using an oscilloscope, hopefully you can get access and knowledge of how to use. Be sure that the reset pins is toggled according to data sheet when programming occurs. And I would use any way possible to identify that any portion of the loaded code is executing--preferably from the very first before the C language startup even executes. I'm not sufficiently familiar with the Arduino compiling environment, but there are definitely start up routines that execute long before the C mainline, and that mainline is going to have to be running to get to the Setup and Loop routines for your Arduino sketch code to ever execute.
In that regard, some seemingly off topic questions:
Is this a commercial project, or is the code you are to write going to be released as open source?
The reason I ask is that you can't release any product based upon the Arduino libraries without making that project open source -- that is the license you agree to to use the Arduino code and libraries. (You signify agreement by using, if you disagree than according to license you are simply commanded to not use. So you are not forced to agree, just forced to not use the library.) If you intend a non-open source release of the system, you might as well start getting used to another development environment.
That said, I'm looking to see how you programmed the chip. (I see, using a UNO as ISP.) If you have wired the standard 2 X 3 programming/debugging header on your new board, and can check that pins are properly connected according to the ATmega32M1 data sheet (not as per other Arduinos, but as per standard debugger/programmer for that particular chip), then another option presents. You can obtain one of the new Atmel ICE debugger/programmers for $55 or so. (I'm sure others here can recommend other similar tools, this is the one we have in our shop.) Then downloading the Atmel Studio you can program a minimal application for the chip and check that your board is working. Use the libraries there (yes difficult to understand, but there are examples) you can single step your way through code using the debugger. In this way you assure that the chip is actually working. Issues of the programming and reset pins, bypass capacitors, proper power supply voltages can prevent proper operation. (By the way if you obtained an Atmel ICE and tried it on a UNO, expect to replace the bootloader as that will erase it!) While I don't at the moment remember how to do it, I'm pretty sure you can even break into the code you loaded (or thought you loaded) as it runs, and inspect step by step in assembly language. There are even some "Arduino" related software tools in Atmel Studio, though I think there may be some costs associated with parts of that, the rest is free.
If you're intending commercial release, you are going to have to recode in some library like that provided by Atmel Studio anyway, so the experience is not wasted. We have found it useful to use Arduino's for early testing, before recoding to target systems "the hard way," so we can quickly knock out prototypes and test system ideas -- this approach of starting with Ardino environment is not in any way to be discouraged.
Next I'm not entirely familiar with the Arduino's start up environment before calling C mainline. Does it attempt to run on the external crystal/resonator? If so, then your modified environment may still be loading code to set that change up, but using the code for the other variants of the ATmega. So one must do couple of things--be sure it properly codes for the M1's crystal, and as you have not done insert the crystal (and properly sized capacitors) or resonator. So how is you say you are not using the external resonator? You know the startup code does not switch to that or you have debugged through that? I suggest making sure what is happening at the very first instructions executed after reset, and code your own experiments there if not getting to the C mainline. (Yes you might have to learn assembly language.) These are standard activities when bringing up a new board design, especially if not using code already tested on that particular micro-controller, which is why I suggested at lest testing with startup code pretty much known to work on the M1. (By the way, don't just trust Atmel, the Atmel Studio is targeted to a huge number of targets and I've had to send error reports on many issues.)
By testing with a single stepping debugger (quite affordable now) you verify that the chip is actually executing and can find out exactly what instruction causes it to suddenly stop working. And if you can break into the code from the Arduino environment, you can find out exactly what the instructions are doing--how they might be mapping the pins incorrectly for example. (Yes the direct port banging is proper way to avoid those issues at first.) Unfortunately this all takes a considerable amount of time, purchasing and loading new tools, getting familiar. If you are developing a "product" this all generally becomes part of the process for initial debugging.